| 제목 | NousResearch hermes-agent 2026.4.16 Path Traversal (CWE-22) |
|---|
| 설명 | # Technical Details
A Denial of Service via device path blocklist bypass exists in the `_is_blocked_device()` method in `tools/file_tools.py` of hermes-agent.
The application fails to adequately normalize file paths (missing `os.path.normpath`), only using `os.path.expanduser()` before checking against an exact string match blocklist (`_BLOCKED_DEVICE_PATHS`), allowing bypass using standard UNIX path traversal sequences (e.g., `/dev/./zero`).
# Vulnerable Code
File: tools/file_tools.py
Method: _is_blocked_device()
Why: The function normalizes the input path using only `os.path.expanduser(filepath)` without resolving traversal components (`.` or `..`). The hardcoded blocklist uses exact membership matching, meaning an input like `/dev/./zero` does not match `/dev/zero`, but the OS kernel transparently resolves it, leading to blocked device access.
# Reproduction
1. Deploy `hermes-agent` with the default file toolset enabled.
2. Send a prompt to the agent: `Please use the read_file tool to read the file at path '/dev/./zero'`.
3. The `os.path.expanduser()` will bypass the blocklist, the device file is opened, and the read_file tool will initiate an infinite read.
4. The agent process hangs indefinitely.
# Impact
- Denial of Service (DoS) resulting in the agent session freezing permanently.
- In gateway modes, repeated attempts can exhaust thread pools, causing complete service denial for all users. |
|---|
| 원천 | ⚠️ https://gist.github.com/YLChen-007/1d1aeff404cb88e06ec2fb3377f49fef |
|---|
| 사용자 | Eric-h (UID 97582) |
|---|
| 제출 | 2026. 04. 24. PM 02:35 (1 월 ago) |
|---|
| 모더레이션 | 2026. 05. 23. AM 11:19 (29 days later) |
|---|
| 상태 | 수락 |
|---|
| VulDB 항목 | 365314 [NousResearch hermes-agent 까지 2026.4.16 read_file Tool tools/file_tools.py _is_blocked_device 디렉토리 순회] |
|---|
| 포인트들 | 20 |
|---|