Bind KdRelay to loopback (#41260)

Restrict the KdRelay listener to local connections. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com> Copilot-Session: d9d1a097-a7bc-4c1b-806b-d3778adfd23a

Ben Hillis committed Aug 6, 2026 at 09:34 UTC 5eb213811c045ddb56aaf56d08112e5c9cf4f29c
1 file changed +1 -1
src/windows/wslrelay/main.cpp
+1 -1
@@ -118,7 +118,7 @@ try
118 sockaddr_in address{};
119 address.sin_family = AF_INET;
120 address.sin_port = htons(port);
121 - address.sin_addr.s_addr = htonl(INADDR_ANY);
121 + address.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
122 THROW_LAST_ERROR_IF(bind(listenSocket.get(), reinterpret_cast<sockaddr*>(&address), sizeof(address)) == SOCKET_ERROR);
123
124 THROW_LAST_ERROR_IF(listen(listenSocket.get(), 1) == SOCKET_ERROR);