fix(security): exclude auth.json and .env from profile exports - #4475
Merged
Conversation
The original PR excluded auth.json from _DEFAULT_EXPORT_EXCLUDE_ROOT and filtered both auth.json and .env from named profile exports, but missed adding .env to the default profile exclusion set. Default exports would still leak .env containing API keys. Added .env to _DEFAULT_EXPORT_EXCLUDE_ROOT, added test coverage, and updated the existing test that incorrectly asserted .env presence.
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
Salvage of #4452 by @dieutx with a follow-up fix.
hermes profile exportincludedauth.jsonand.envin archives — leaking API keys, OAuth tokens, and credential pool entries when users share exported profiles.Changes
From #4452 (cherry-picked, @dieutx):
auth.jsonto_DEFAULT_EXPORT_EXCLUDE_ROOTauth.jsonand.envFollow-up fix:
.envto_DEFAULT_EXPORT_EXCLUDE_ROOT(the original PR missed this — default profile exports would still leak.env).envin default exclusion set.envpresence in exportsTest results
83 profile tests passed + E2E verification of both default and named profile export paths confirming credentials are excluded and legitimate files are preserved.