| tiêu đề | NousResearch hermes-agent 2026.4.16 Missing Authorization (CWE-862) |
|---|
| Mô tả | # Technical Details
A dangerous command approval bypass exists in the `check_all_command_guards()` method in `tools/approval.py` of hermes-agent.
The application fails to safely handle default contexts in `batch_runner.py` by treating unknown execution contexts (where interactive environment variables are unset) as implicitly safe instead of implicitly dangerous, allowing all flagged dangerous commands to be auto-approved.
# Vulnerable Code
File: tools/approval.py
Method: check_all_command_guards()
Why: The function checks for interactive environment variables (HERMES_INTERACTIVE, HERMES_GATEWAY_SESSION, HERMES_EXEC_ASK, HERMES_CRON_SESSION) and if none are set, the code falls through to an insecure default returning `{"approved": True, "message": None}` for any command.
# Reproduction
1. Prepare a `hermes-agent` environment.
2. Run a batch execution process using `batch_runner.py` with an unset interactive context.
3. Supply a malicious JSONL dataset containing a prompt injection payload that executes dangerous shell commands (e.g., `rm -rf /`).
4. Observe the commands are executed directly without approval.
# Impact
- Arbitrary command execution (RCE) on the host running the batch runner.
- Credential theft (e.g., reading `~/.hermes/.env`).
- Establishment of reverse shells or data exfiltration. |
|---|
| Nguồn | ⚠️ https://gist.github.com/YLChen-007/22cada4c9060f5123dde6185135ae3ab |
|---|
| Người dùng | Eric-h (UID 97582) |
|---|
| Đệ trình | 24/04/2026 14:35 (cách đây 1 tháng) |
|---|
| Kiểm duyệt | 23/05/2026 11:19 (29 days later) |
|---|
| Trạng thái | được chấp nhận |
|---|
| Mục VulDB | 365313 [NousResearch hermes-agent đến 2026.4.16 Batch Runner tools/approval.py check_all_command_guards nâng cao đặc quyền] |
|---|
| điểm | 20 |
|---|