fix(tools): restrict RPC socket permissions to owner-only

The code execution sandbox creates a Unix domain socket in /tmp with
default permissions, allowing any local user to connect and execute
tool calls. Restrict to 0o600 after bind.

Closes #6230
This commit is contained in:
Jaffar Keikei 2026-04-08 13:14:30 -04:00 committed by Teknium
parent 80108104cf
commit c47d4eda13

View file

@ -979,6 +979,7 @@ def execute_code(
# --- Start UDS server ---
server_sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
server_sock.bind(sock_path)
os.chmod(sock_path, 0o600)
server_sock.listen(1)
rpc_thread = threading.Thread(