Vulnerability DatabaseCVE-2026-130164

CVE-2026-130164: 
Python vulnerability analysis and mitigation

Overview

CVE-2026-130164 is a high-severity environment variable injection vulnerability in the hermes-agent Python package (NousResearch) that allows code running inside a terminal backend to set arbitrary environment variables for processes on the agent machine, enabling code execution as the gateway user. It affects versions >= 0.21.6 and < 0.23.2, introduced when tools/bot_desktop/sandbox_host.py was added in v0.21.6 (2026-09-28). The vulnerability was disclosed on November 19, 2026 via a GitHub Security Advisory. It carries a CVSS v3.1 base score of 7.8 (High) (GitHub Advisory).

Technical details

The root cause is classified under CWE-15 (External Control of System or Configuration Setting) and CWE-426 (Untrusted Search Path). The vulnerable code path in tools/bot_desktop/sandbox_host.py (_published(), lines 206–217) runs cat /env inside the terminal backend and stores every KEY=VALUE pair with no key or value validation. The resulting environment variables are merged into processes spawned on the agent machine — including the browser harness, cua-driver helper spawns, and local terminal children — via a chain through runtime.py → browser_session.py → browser_use_cli.py. Because the /hermes-bot-desktop/<session>/env directory is writable by any process inside the backend, an attacker-controlled dependency or script can inject variables such as LD_PRELOAD or DYLD_INSERT_LIBRARIES to achieve code execution on the agent machine (GitHub Advisory).

Impact

Successful exploitation grants code execution on the agent machine as the gateway user, exposing provider API keys, authentication tokens, session history, and connected account credentials stored under the Hermes home directory. On Linux hosts where the gateway user has access to a rootful Docker daemon, this is effectively equivalent to root-level compromise. The attack crosses the declared terminal-backend isolation boundary (SECURITY.md §2.2), constituting an escape from an OS-level isolation posture (GitHub Advisory).

Exploitability

Exploitation requires a non-local terminal backend (docker or ssh) with Bot Desktop running inside it, and a subsequent browser or computer-use spawn on the agent machine — making it a local attack vector with high complexity and low privileges required. The advisory documents a proven end-to-end reproduction using real product code (no stubs): writing a shared library to /workspace (a bind mount visible on the agent host) and appending LD_PRELOAD=/x.so to the env file, resulting in code execution as uid 1000 (Linux) or uid 501 (macOS via DYLD_INSERT_LIBRARIES). No public exploit kits or in-the-wild exploitation have been reported, and no EPSS score or CISA KEV listing is currently available for this CVE (GitHub Advisory).

Exploitation steps

  1. Precondition check: Confirm the target is running hermes-agent v0.21.6–v0.23.1 with Bot Desktop hosted inside a docker or ssh terminal backend, and that a browser or computer-use action will be triggered later.
  2. Gain code execution inside the backend: Exploit a malicious dependency, script, or agent-executed shell command running inside the Docker/SSH backend environment.
  3. Identify the bind-mount path: Read /proc/self/mountinfo inside the backend to find the host path of the /workspace bind mount, which is accessible from both the backend and the agent machine.
  4. Write a malicious shared library: Compile or drop a shared library (e.g., x.so on Linux or x.dylib on macOS) with a constructor payload into /workspace on the backend (which maps to the agent host filesystem).
  5. Inject the environment variable: Append LD_PRELOAD=/workspace/x.so (Linux) or DYLD_INSERT_LIBRARIES=/workspace/x.dylib (macOS) to /tmp/hermes-bot-desktop/<session>/env inside the backend.
  6. Trigger agent-side process spawn: Wait for or trigger a browser_exec or computer-use call; the agent reads the env file without validation and passes the injected variable to the harness Popen call on the agent machine.
  7. Achieve code execution: The shared library constructor executes as the gateway user (uid 1000 on Linux, uid 501 on macOS), enabling credential theft, persistence, or further lateral movement (GitHub Advisory).

Indicators of compromise

  • File System: Unexpected shared libraries (.so, .dylib) in /workspace or other bind-mounted directories accessible from both the backend and agent host; unexpected entries in /tmp/hermes-bot-desktop/<session>/env beyond the six expected keys (DISPLAY, XAUTHORITY, DBUS_SESSION_BUS_ADDRESS, XDG_CONFIG_HOME, XDG_CACHE_HOME, XDG_DATA_HOME).
  • Process: Browser harness or cua-driver child processes spawned with unusual environment variables such as LD_PRELOAD, DYLD_INSERT_LIBRARIES, PATH overrides, or unexpected proxy variables; unexpected child processes or network connections originating from the browser harness process.
  • Logs: Agent-side logs showing browser_exec or computer-use spawns with environment variables not written by launcher.sh; unexpected process execution under the gateway user account coinciding with backend activity (GitHub Advisory).

Mitigation and workarounds

Upgrade hermes-agent to v0.23.2 or later, which fixes the issue by restricting the env file reader to only the six keys written by launcher.sh and validating their values (e.g., DISPLAY must match a plain X display format; other values must be non-empty and printable). Additionally, the fix ensures that values published by a backend-hosted screen are no longer merged into agent-machine process environments. As a workaround on affected versions, set bot_desktop.placement: gateway or use the default local backend to avoid running Bot Desktop inside a docker or ssh terminal backend (GitHub Advisory).

Additional resources


Source: This report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-hhqh-8jpj-27rfCRITICAL9.8
  • Python logoPython
  • lmcache
NoYesNov 23, 2026
CVE-2026-130164HIGH7.8
  • Python logoPython
  • hermes-agent
NoYesNov 23, 2026
GHSA-v8x2-8vhg-5vc3MEDIUM5.8
  • Python logoPython
  • nautobot
NoYesNov 23, 2026
GHSA-gfqr-fp2c-h495MEDIUM5.4
  • Python logoPython
  • nautobot
NoYesNov 23, 2026
GHSA-jg4p-wprm-8hphMEDIUM5.3
  • Python logoPython
  • lmcache
NoYesNov 23, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management