| عنوان | NousResearch hermes-agent <= 0.12.0 Injection (CWE-74) |
|---|
| الوصف | # Technical Details
A Prompt Injection vulnerability exists in the `_compress_context` method in `run_agent.py` and `TodoStore.format_for_injection()` in `tools/todo_tool.py` of hermes-agent.
The application fails to sanitize or escape todo item contents before appending them directly into the compressed message array as an authoritative `{"role": "user"}` message.
# Vulnerable Code
File: run_agent.py and tools/todo_tool.py
Method: _compress_context and TodoStore.format_for_injection
Why: Raw todo item content is appended directly as an authoritative user message at the end of the context during compression, allowing attacker payloads to override prior system instructions.
# Reproduction
1. Interact with the agent to create a malicious todo item containing an injection payload (e.g., via the `/v1/chat/completions` API).
2. Continue the conversation until context compression is triggered.
3. The injected payload becomes the last user message in the context, successfully hijacking the agent's behavior.
# Impact
- Override system instructions and safety directives.
- Exfiltrate sensitive data such as environment variables or API keys, and abuse tools to execute shell commands. |
|---|
| المصدر | ⚠️ https://gist.github.com/YLChen-007/d343fcfe2c009cd45f56dc475fd5ac03 |
|---|
| المستخدم | Eric-j (UID 98073) |
|---|
| ارسال | 07/05/2026 03:38 PM (28 أيام منذ) |
|---|
| الاعتدال | 31/05/2026 09:51 AM (24 days later) |
|---|
| الحالة | تمت الموافقة |
|---|
| إدخال VulDB | 367500 [NousResearch hermes-agent حتى 0.12.0 run_agent.py _compress_context تجاوز الصلاحيات] |
|---|
| النقاط | 20 |
|---|