fix(gateway): block Hermes home media attachments - #35939
Conversation
|
I verified this change — the blanket denial of the entire HERMES_HOME directory is the correct security posture, and the allowlist override semantics are preserved. Verification details:
Note: The existing merged PR #35634 denied specific Hermes root files. This PR supersedes that approach with a blanket denial — cleaner and more future-proof. The PR body should mention this supersedes #35634's per-file approach. No issues found. Ready to merge. |
…-hermes-home-block-20260601
|
Looks mergeable from this security review. Checked current Validation:
Signed: GPT-5.5-xhigh in Codex |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused media-delivery security review. Current main has moved to a deliberately targeted model rather than a whole-Hermes-home denial.
Problems
- The added whole-root deny would break the current contract at
gateway/platforms/base.py:1163-1165: non-credential skills, logs, and ad-hoc Hermes-home files remain deliverable.tests/gateway/test_platform_base.py:1165-1184explicitly asserts a fresh~/.hermes/adhoc_report.pdfis delivered and says it prevents reintroducing the rejected whole-tree deny. - The listed OAuth/MCP paths are now protected individually:
.anthropic_oauth.jsonandauth/google_oauth.jsonare denied atgateway/platforms/base.py:1172-1179;mcp-tokens/is denied atgateway/platforms/base.py:1185-1202via 42d0174.
Suggested changes
- Re-scope to a specifically unprotected sensitive store, preserving the current ad-hoc artifact behavior. Session/SQLite-store denial is already being handled by open PR #41071.
Automated hermes-sweeper review.
| denied.append(hermes_root / "config.yaml") | ||
| denied.append(hermes_root) | ||
| return denied | ||
|
|
There was a problem hiding this comment.
This whole-root deny reverses current main's intentional targeted policy. Main explicitly preserves fresh non-credential files under Hermes home (tests/gateway/test_platform_base.py:1165-1184); please re-scope to a concrete sensitive path instead.
SummaryTwo PRs address the issue's Hermes media-delivery path protection. #35634 adds shared-root blocking for named configuration and credential files, while #35939 broadens the deny rule to non-cache files under the active Hermes home and shared root to cover additional token and session state. Related pull requests
Duplicates#35634 and #35939 overlap in Hermes-root media-delivery protection, but they are not the same change: merged #35634 covers named config/credential paths, whereas #35939 proposes blanket non-cache root denial. Suggested consolidationauthor action: rebase onto main, or split out the part that can merge. Do not merge #35939 over the [PR review:COMMENTED] keep_open review: re-scope it to a specifically unprotected sensitive store while preserving the documented ad-hoc artifact behavior; session/SQLite coverage is already being handled by #41071. #35634 is already merged and should not be reopened. Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 10 kB of PR diffs, 2 kB of issue/PR text, 5 kB of discussion (5 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
HERMES_MEDIA_ALLOW_DIRSoperator roots.HERMES_HOME, cache allowlist precedence, and operator allowlist precedence.Why
Default media delivery mode blocked a few named Hermes credential files, but other non-cache Hermes state files such as OAuth refresh tokens, MCP token JSON, and session metadata could still be attached if a model emitted their path. Cache and explicit operator roots are already checked first, so denying the Hermes roots closes that leak without breaking generated artifact delivery.
Related
Tests
ruff check gateway/platforms/base.py tests/gateway/test_platform_base.py tests/gateway/test_extract_local_files.pypython -X utf8 -m pytest -p no:cacheprovider tests/gateway/test_platform_base.py::TestMediaDeliveryDefaultMode tests/gateway/test_extract_local_files.py -q --timeout-method=threadruff check .