mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
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:
parent
80108104cf
commit
c47d4eda13
1 changed files with 1 additions and 0 deletions
|
|
@ -979,6 +979,7 @@ def execute_code(
|
||||||
# --- Start UDS server ---
|
# --- Start UDS server ---
|
||||||
server_sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
server_sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||||
server_sock.bind(sock_path)
|
server_sock.bind(sock_path)
|
||||||
|
os.chmod(sock_path, 0o600)
|
||||||
server_sock.listen(1)
|
server_sock.listen(1)
|
||||||
|
|
||||||
rpc_thread = threading.Thread(
|
rpc_thread = threading.Thread(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue