hermes - 💡(How to fix) Fix security: code execution sandbox runs with same UID and no seccomp/network isolation [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

tools/code_execution_tool.py spawns a Python subprocess.Popen with a scrubbed environment, but the child process runs with the same UID/GID as the parent Hermes process. There is no seccomp-bpf, no chroot, no network namespace, and no capability dropping.

Root Cause

tools/code_execution_tool.py spawns a Python subprocess.Popen with a scrubbed environment, but the child process runs with the same UID/GID as the parent Hermes process. There is no seccomp-bpf, no chroot, no network namespace, and no capability dropping.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Summary

tools/code_execution_tool.py spawns a Python subprocess.Popen with a scrubbed environment, but the child process runs with the same UID/GID as the parent Hermes process. There is no seccomp-bpf, no chroot, no network namespace, and no capability dropping.

Impact

User-supplied Python code (via execute_code) can:

  • Read any file the OS user can access (e.g., ~/.ssh/id_rsa, /proc/<ppid>/environ)
  • Exfiltrate data over the network
  • Dump the parent process memory via /proc/<ppid>/mem
  • Install persistence mechanisms (cron jobs, systemd units, SSH keys)
  • Spawn additional processes outside the agent's control

Recommendation

Run execute_code in a proper sandbox:

  • Docker container with --network=none, limited volume mounts, a seccomp profile, and AppArmor/SELinux labels
  • At minimum: use a separate unprivileged user, a chroot jail, and drop all unnecessary capabilities
  • Consider using gVisor, Firecracker, or nsjail for stronger isolation

Files

  • tools/code_execution_tool.py
  • tools/environments/local.py

Severity: HIGH

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix security: code execution sandbox runs with same UID and no seccomp/network isolation [1 pull requests]