# CVE-2026-9368: NousResearch hermes-agent sandbox bypass in execute_code tool

Source: https://junglewise.ai/threats/cve-2026-9368-nousresearch-hermes-agent-sandbox-bypass-in-execute-code-tool  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-24. Updated: 2026-06-30  
License: CC BY 4.0 with a link back

CVE-2026-9368 · Severity: high · CVSS 7.3 · Published 2026-05-24

NousResearch hermes-agent is an AI-driven agent capable of executing code and commands. A security flaw in its code execution tool allows the AI to run arbitrary Python scripts on the host machine without the required safety approvals or manual confirmation. This could allow a remote attacker to steal sensitive credentials (like database URLs or cloud access keys) or perform destructive actions on the server where the agent is running.

Technologies: [NousResearch Hermes Agent](https://junglewise.ai/threats/technologies/hermes-agent), [hermes-agent (PyPI)](https://junglewise.ai/threats/technologies/pypi-hermes-agent). Vendors: [NousResearch](https://junglewise.ai/threats/vendors/nousresearch), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-9368 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-9368 being exploited in the wild.

**How severe is CVE-2026-9368?** High severity, with a CVSS score of 7.3, published 24 May 2026.

**Which products and versions are affected?** NousResearch Hermes Agent < 0.11.0, <= 2026.4.16; hermes-agent (PyPI) ECOSYSTEM:introduced=0,fixed=0.11.0.

**Is there a fix for CVE-2026-9368?** Yes. hermes-agent (PyPI): upgrade to 0.11.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-9368 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-9368?** Check whether you run NousResearch Hermes Agent or hermes-agent (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- hermes-agent (PyPI): upgrade to 0.11.0 or later

  ```sh
  pip install "hermes-agent>=0.11.0"
  ```


## Technical details

A vulnerability in the `execute_code` function within `tools/code_execution_tool.py` allows LLM-generated Python scripts to bypass the `tools/approval.py` guardrails that normally protect the terminal tool. While the agent attempts to sanitize the environment passed to the subprocess using a substring-based blocklist (`_SECRET_SUBSTRINGS`), the list is incomplete and fails to filter common sensitive variables like `DATABASE_URL` or `AWS_ACCESS_ID`. Furthermore, because the `execute_code` path does not invoke `_check_all_guards()`, an attacker can execute arbitrary Python code to read sensitive files from disk or perform system-level commands without user interaction. The issue is addressed in version 0.11.0.

## Affected products

- NousResearch hermes-agent < 0.11.0

## Identifiers

- CVE-2026-9368
- GHSA-wm96-9gfh-vvgq
- PYSEC-2026-2515

## Timeline

- 2026-04-24: disclosed: Initial vulnerability report and PoC published on GitHub Gist.
- 2026-05-24: advisory: NVD published CVE-2026-9368.
- 2026-05-26: advisory: GitHub Advisory GHSA-wm96-9gfh-vvgq published.
- 2026-06-30: patched: Advisory updated to reflect patched version 0.11.0.

## References

- [https://gist.github.com/YLChen-007/43c72d19668421abe8ce10f299323a0a](https://gist.github.com/YLChen-007/43c72d19668421abe8ce10f299323a0a)
- [https://vuldb.com/submit/812229](https://vuldb.com/submit/812229)
- [https://vuldb.com/vuln/365331](https://vuldb.com/vuln/365331)
- [https://vuldb.com/vuln/365331/cti](https://vuldb.com/vuln/365331/cti)
- [https://github.com/NousResearch/hermes-agent/commit/285bb2b9150b93445e5eded9bc897a4001b66e55](https://github.com/NousResearch/hermes-agent/commit/285bb2b9150b93445e5eded9bc897a4001b66e55)

## Related threats

- [NousResearch hermes-agent resource exhaustion in resourceBufferFromUrl](https://junglewise.ai/threats/cve-2026-85107-nousresearch-hermes-agent-resource-exhaustion-in)
- [NousResearch hermes-agent server-side request forgery in Link Title Fetch](https://junglewise.ai/threats/cve-2026-85106-nousresearch-hermes-agent-server-side-request-forgery-in-link)
- [NousResearch hermes-agent authorization bypass in Session Management](https://junglewise.ai/threats/cve-2026-85105-nousresearch-hermes-agent-authorization-bypass-in-session)
- [NousResearch hermes-agent denial of service in MCP Tool](https://junglewise.ai/threats/cve-2026-84289-nousresearch-hermes-agent-denial-of-service-in-mcp-tool)
- [NousResearch hermes-agent denial of service in ACP Prompt Workflow](https://junglewise.ai/threats/cve-2026-84288-nousresearch-hermes-agent-denial-of-service-in-acp-prompt)
