mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-02 07:11:49 +00:00
fix(security): add missing credential paths to write denylist (#27217)
The write denylist already protects SSH keys, AWS, GPG, npm, PyPI, Docker, Azure, and GitHub CLI credentials. Two common credential stores were missing: ~/.git-credentials stores plaintext git tokens in the format https://username:token@github.com when using git credential-store. It is directly analogous to ~/.netrc which was already protected. ~/.config/gcloud/ contains Google Cloud OAuth tokens and service account credentials. It is directly analogous to ~/.aws/ which was already protected. Under prompt injection, an agent could be instructed to overwrite these files, destroying credentials or planting malicious ones. Verified before and after with is_write_denied() on both paths.
This commit is contained in:
parent
9c08070703
commit
fa957c06cf
1 changed files with 2 additions and 0 deletions
|
|
@ -50,6 +50,7 @@ def build_write_denied_paths(home: str) -> set[str]:
|
|||
os.path.join(home, ".pgpass"),
|
||||
os.path.join(home, ".npmrc"),
|
||||
os.path.join(home, ".pypirc"),
|
||||
os.path.join(home, ".git-credentials"),
|
||||
"/etc/sudoers",
|
||||
"/etc/passwd",
|
||||
"/etc/shadow",
|
||||
|
|
@ -71,6 +72,7 @@ def build_write_denied_prefixes(home: str) -> list[str]:
|
|||
os.path.join(home, ".docker"),
|
||||
os.path.join(home, ".azure"),
|
||||
os.path.join(home, ".config", "gh"),
|
||||
os.path.join(home, ".config", "gcloud"),
|
||||
]
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue