fix(security): block user credential reads - #35997
Open
zapabob wants to merge 1 commit into
Open
Conversation
13 tasks
Contributor
|
Thanks for the focused hardening contribution. The premise remains valid on current The current file has moved since the PR ( Automated hermes-sweeper review. |
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_filefrom directly reading common user credential stores under the OS home directory (~/.ssh,~/.aws,~/.kube,~/.docker, GitHub/gcloud credential dirs, and exact files like~/.netrc,~/.npmrc,~/.pypirc,~/.git-credentials)agent.file_safety.get_read_block_error(), so existing read_file and ACP read-text-file callers share the same defense-in-depth policy.env.example/ non-Hermes auth fixturesRefs #16809
Refs #16851
Refs #17656
Validation
python -m pytest -p no:cacheprovider tests\agent\test_file_safety_credentials.py -q --timeout-method=thread(35 passed, 1 skipped)python -m pytest -p no:cacheprovider tests\agent\test_file_safety.py tests\agent\test_file_safety_credentials.py tests\tools\test_file_read_guards.py -q --timeout-method=thread(90 passed, 4 skipped)ruff check agent\file_safety.py tests\agent\test_file_safety_credentials.py --no-cacheruff check . --no-cachegit diff --check upstream/main..HEADNote: this is defense-in-depth, matching the existing file safety wording; the terminal tool runs as the same OS user and is not a sandbox boundary.