CVE-2026-9366 NousResearch hermes-agent prompt_builder.py _scan_context_content injection
Remote attackers can inject code via the _scan_context_content function in the hermes-agent library, potentially leading to arbitrary code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-9366?
CVE-2026-9366 is a medium-severity code injection vulnerability in NousResearch hermes-agent, published on 24 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
A vulnerability was found in NousResearch hermes-agent 2026.4.23. The impacted element is the function _scan_context_content of the file agent/prompt_builder.py. The manipulation results in injection. The attack may be performed from remote. The exploit has been made public and could be used. The vendor was contacted early about this disclosure but did not respond in any way.
Which versions are affected by CVE-2026-9366?
3 open source packages ship an affected version, including hermes-agent.
| Package | Affected | Fixed in |
|---|---|---|
hermes-agent PyPI | All versions | 0.15.0 |
hermes-agent PyPI | All versions | 0.15.0 |
hermes-agent PyPI | All versions | 0.15.0 |
How do I fix CVE-2026-9366?
Upgrade hermes-agent to 0.15.0 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-9366 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-9366 exists.
Sources
Also known as GHSA-pgp4-xr4j-h5cg, PYSEC-2026-2514.