fix(security): add read-path deny list for credential and secret files#2714
Closed
dieutx wants to merge 1 commit into
Closed
fix(security): add read-path deny list for credential and secret files#2714dieutx wants to merge 1 commit into
dieutx wants to merge 1 commit into
Conversation
The file tools have a write deny list (WRITE_DENIED_PATHS) that blocks writes to .env, .ssh/*, /etc/shadow, etc. but no equivalent for reads. read_file() can read any file on the filesystem including API keys, OAuth tokens, SSH private keys, and shadow passwords. Add READ_DENIED_PATHS and READ_DENIED_PREFIXES matching the most sensitive credential paths, and enforce in read_file() and search(). Also blocks traversal paths like /tmp/../etc/shadow via realpath(). Non-secret config files (~/.hermes/config.yaml) and session files remain readable.
This was referenced Mar 30, 2026
Contributor
Author
|
Closing — needs more thought on the right scope. The write deny list already covers the critical paths. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
read_filehas zero path restrictions — reads ANY file including/etc/shadow,~/.hermes/.env(API keys),~/.hermes/auth.json(OAuth tokens), SSH private keys_is_write_denied()with a deny list, but no equivalent exists for readsREAD_DENIED_PATHSandREAD_DENIED_PREFIXEScovering credential files, and enforce in bothread_file()andsearch()~/.hermes/config.yamland session files remain readableSecurity Impact
read_file("~/.hermes/.env")→ exfiltrates all API keys~/.hermes/auth.json(OAuth tokens, refresh tokens),~/.ssh/id_rsa,/etc/shadowHow to reproduce
How to test
Platform tested