# CVE-2026-10222: NousResearch hermes-agent injection in _sanitize_env_lines

Source: https://junglewise.ai/threats/cve-2026-10222-nousresearch-hermes-agent-injection-in-sanitize-env-lines  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-01. Updated: 2026-07-09  
License: CC BY 4.0 with a link back

CVE-2026-10222 · Severity: medium · CVSS 5.6 · Published 2026-06-01

NousResearch hermes-agent, a tool for managing AI agent configurations, contains a flaw in how it processes configuration files. An attacker could trick a user into using a specially crafted API key that contains hidden configuration commands. If successful, this allows the attacker to silently redirect the AI's traffic to a malicious server, potentially stealing sensitive prompts, responses, and legitimate credentials.

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-10222 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-10222 being exploited in the wild.

**How severe is CVE-2026-10222?** Medium severity, with a CVSS score of 5.6, published 1 June 2026.

**Which products and versions are affected?** hermes-agent (PyPI) ECOSYSTEM:introduced=0,fixed=0.18.0.

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

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

**Am I affected by CVE-2026-10222?** 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.18.0 or later

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


## Technical details

A semantic injection vulnerability exists in the `_sanitize_env_lines` function within `hermes_cli/config.py` of NousResearch hermes-agent. The parser uses a naive `str.find()` method to split concatenated environment variables without verifying word boundaries. An attacker can craft a malicious credential (e.g., an API key) that embeds a known configuration key like `OPENAI_BASE_URL`. When the agent saves or loads this configuration, the parser incorrectly splits the line, treating the embedded string as a legitimate configuration override. This allows for persistent redirection of API traffic to attacker-controlled infrastructure. The issue is fixed in version 0.18.0.

## Affected products

- NousResearch hermes-agent < 0.18.0

## Identifiers

- CVE-2026-10222
- GHSA-mv8x-fg99-32mf
- PYSEC-2026-2513

## Timeline

- 2026-05-07: disclosed: Initial PoC and issue report created by researcher.
- 2026-06-01: advisory: CVE-2026-10222 published.
- 2026-07-09: patched: GitHub Advisory reviewed and patch version 0.18.0 confirmed.

## References

- [https://gist.github.com/YLChen-007/7ee2eeaa383b3540d2e8854250c03fb0](https://gist.github.com/YLChen-007/7ee2eeaa383b3540d2e8854250c03fb0)
- [https://vuldb.com/cve/CVE-2026-10222](https://vuldb.com/cve/CVE-2026-10222)
- [https://vuldb.com/submit/822020](https://vuldb.com/submit/822020)
- [https://vuldb.com/vuln/367501](https://vuldb.com/vuln/367501)
- [https://vuldb.com/vuln/367501/cti](https://vuldb.com/vuln/367501/cti)

## 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)
