Skip to content

Commit 683707c

Browse files
authored
[Security][Bug] Prevent binding to all TCP interfaces (#5752)
1 parent a68ed76 commit 683707c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/sglang/srt/distributed/device_communicators/shm_broadcast.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ def __init__(
225225
remote_subscribe_port = get_open_port()
226226
if is_valid_ipv6_address(connect_ip):
227227
self.remote_socket.setsockopt(IPV6, 1)
228-
socket_addr = f"tcp://*:{remote_subscribe_port}"
228+
connect_ip = f"[{connect_ip}]"
229+
socket_addr = f"tcp://{connect_ip}:{remote_subscribe_port}"
229230
self.remote_socket.bind(socket_addr)
230231

231232
else:

0 commit comments

Comments
 (0)