NousResearch hermes-agent <= 0.12.0 Code Injection Vulnerability (CVE-2026-10221)
NousResearch hermes-agent up to version 0.12.0 is vulnerable to code injection in the _compress_context function of the run_agent.py file, allowing remote exploitation.
A code injection vulnerability, tracked as CVE-2026-10221, affects NousResearch hermes-agent versions up to 0.12.0. The vulnerability resides within the _compress_context function of the run_agent.py file, allowing for potential code injection through manipulation of input. Remote exploitation is possible, and a public exploit is reportedly available. The vendor was notified but has not responded. This vulnerability allows an attacker to execute arbitrary code on systems running a vulnerable version of hermes-agent.
Attack Chain
- Attacker identifies a vulnerable instance of NousResearch hermes-agent running version 0.12.0 or earlier.
- Attacker crafts a malicious input string designed to exploit the code injection vulnerability in the
_compress_contextfunction withinrun_agent.py. - The attacker sends the malicious input to the vulnerable function, likely through a network request, triggering the injection point.
- The
_compress_contextfunction processes the attacker-controlled input without proper sanitization or validation. - The malicious input is interpreted as code and executed by the hermes-agent application, potentially granting the attacker control over the system.
- Attacker leverages the injected code to establish persistence on the compromised system, allowing for continued access.
- Attacker pivots to other internal systems and attempts to access or exfiltrate sensitive data.
Impact
Successful exploitation of this vulnerability could lead to arbitrary code execution on the affected system. This could allow an attacker to gain complete control over the hermes-agent instance, potentially leading to data theft, system compromise, or further lateral movement within the network. Due to the nature of the software, this is especially dangerous in AI/ML environments.
Recommendation
- Apply appropriate input validation and sanitization to the
_compress_contextfunction inrun_agent.py(reference CVE-2026-10221). - Deploy the Sigma rule
Detect CVE-2026-10221 Exploitation Attempt via run_agent.pyto your SIEM and tune for your environment to detect exploitation attempts targeting the vulnerable function. - Monitor network traffic for suspicious activity targeting NousResearch hermes-agent, especially related to calls to the
_compress_contextfunction.
Detection coverage 2
Detect CVE-2026-10221 Exploitation Attempt via run_agent.py
highDetects attempts to exploit CVE-2026-10221 via malicious input to run_agent.py
Detect CVE-2026-10221 Exploitation via Network Request
highDetects CVE-2026-10221 exploitation — Detects HTTP requests containing shell metacharacters targeting hermes-agent's API endpoints
Detection queries are available on the platform. Get full rules →