CVE-2026-130164 in Hermes Agent
Summary
by MITRE • 11/23/2026
Hermes Agent is an open-source autonomous AI agent built by Nous Research for running tool-using workflows across CLI, desktop, and messaging interfaces. From 0.21.6 to 0.23.1, when Bot Desktop is hosted inside a non-local terminal backend, the agent process reads a backend-writable screen environment file without validating keys or values and merges its entries into the environment of processes started on the agent machine. Specifically, when terminal.backend is set to docker or ssh (or a plugin backend declaring supports_streams) with placement auto or terminal, _published() in tools/bot_desktop/sandbox_host.py accepts arbitrary KEY=VALUE lines from the hermes-bot-desktop env file and propagates them via tools/bot_desktop/runtime.py into the browser harness, computer-use helpers, and local terminal children. Code running inside the terminal backend can therefore set variables such as LD_PRELOAD, DYLD_INSERT_LIBRARIES, or PATH and gain code execution on the agent machine as the gateway user upon a subsequent browser or computer-use spawn, exposing credentials, tokens, and session history under the Hermes home directory. The default local backend, backends that cannot host a screen (Modal, Daytona, and Vercel), and Hermes Cloud in its default configuration are not affected. This issue is fixed in version 0.23.2.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/28/2026
The vulnerability identified within the Hermes Agent software, specifically affecting versions from 0.21.6 through 0.23.1, represents a critical insecure environment variable handling flaw that enables remote code execution and credential theft when specific non-local terminal backends are utilized. Hermes Agent is an open-source autonomous AI agent designed to execute tool-using workflows across command-line interfaces, desktop environments, and messaging platforms. The core of the vulnerability lies in how the application manages configuration files for its Bot Desktop component when deployed within a sandboxed or remote environment such as Docker or SSH. In these configurations, the system relies on reading an environment file that is writable by the terminal backend process to configure the agent's runtime behavior. This design choice creates a trust boundary violation where the integrity of the local execution environment depends entirely on the security posture of the remote backend, which may be compromised or controlled by an attacker.
The technical mechanism of exploitation involves the unvalidated merging of key-value pairs from this external file into the process environment of the Hermes agent. When the terminal backend is configured to use Docker, SSH, or any plugin that supports streams with auto or terminal placement, the _published function in tools/bot_desktop/sandbox_host.py accepts arbitrary KEY=VALUE lines without performing sufficient validation on either the keys or their corresponding values. These untrusted environment variables are then propagated via tools/bot_desktop/runtime.py into various components of the agent's architecture, including the browser harness, computer-use helpers, and local terminal child processes. This propagation occurs during the initialization phase when a new session is spawned, effectively injecting malicious configuration directives directly into the execution context of privileged or sensitive operations within the agent machine.
The operational impact of this flaw is severe, as it allows an attacker with control over the terminal backend to achieve arbitrary code execution on the host machine running the Hermes Agent under the identity of the gateway user. By manipulating specific environment variables such as LD_PRELOAD for Linux systems or DYLD_INSERT_LIBRARIES for macOS environments, an attacker can force the loading of malicious shared libraries into the address space of subsequent processes launched by the agent. Alternatively, modifying the PATH variable allows for command hijacking, where legitimate binaries are replaced with malicious equivalents that execute before the intended program. This capability effectively bypasses local security controls and grants the attacker full control over the host system's execution flow during any interaction involving browser automation or computer-use tasks initiated by the AI agent.
Beyond direct code execution, this vulnerability facilitates significant data exfiltration and session hijacking. Since the injected environment variables affect processes that handle user interactions, an attacker can manipulate paths to capture sensitive artifacts stored under the Hermes home directory. This includes access to authentication credentials, API tokens, browser cookies, and complete browsing history. The compromise of these assets allows for persistent unauthorized access to external services linked to the agent's identity, potentially leading to broader network infiltration if those credentials are reused across other systems. The vulnerability is particularly dangerous because it exploits the automated nature of AI agents; users may not be aware that background processes initiated by the agent are executing malicious code derived from their own configuration files or those manipulated via a compromised backend service.
From a classification perspective, this issue aligns with CWE-15: External Control of System or Configuration Setting and CWE-78: Improper Neutralization of Special Elements used in an OS Command, specifically regarding environment variable injection. In the context of the MITRE ATT&CK framework, this vulnerability supports techniques related to Environment Variable Hijacking (T1098) for persistence and access, as well as potential command-and-control channels if the agent is configured to communicate with external servers using compromised credentials. The attack vector leverages the trust relationship between the local agent process and its remote backend, highlighting a common architectural risk in distributed AI systems where configuration data flows across security boundaries without adequate sanitization.
The default local terminal backend is not affected by this vulnerability because it does not involve reading from an externally writable file in the same manner as Docker or SSH backends. Similarly, platforms such as Modal, Daytona, and Vercel are unaffected due to their inability to host a screen session required for this specific code path to execute. Hermes Cloud deployments using default configurations also remain secure against this particular exploitation vector. The root cause is fundamentally a lack of input validation on configuration data sourced from untrusted or semi-trusted external processes within the agent's runtime environment.
To mitigate this vulnerability, users must upgrade immediately to version 0.23.2 or later, where the issue has been resolved through stricter validation and sanitization of environment variables before they are merged into the process context. For organizations unable to patch immediately, it is critical to audit any custom terminal backends used with Hermes Agent to ensure that no external service can write arbitrary content to configuration files read by the agent. Additionally, restricting file permissions on backend-writable directories and implementing strict allow-lists for permitted environment variable keys can reduce the attack surface. Security teams should also monitor for unusual process spawning patterns or library loading events that may indicate exploitation attempts against older versions still in production environments.