Skip to content

fix(security): exclude auth.json and .env from profile exports - #4475

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-f4786c9c
Apr 1, 2026
Merged

fix(security): exclude auth.json and .env from profile exports#4475
teknium1 merged 2 commits into
mainfrom
hermes/hermes-f4786c9c

Conversation

@teknium1

@teknium1 teknium1 commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Salvage of #4452 by @dieutx with a follow-up fix.

hermes profile export included auth.json and .env in archives — leaking API keys, OAuth tokens, and credential pool entries when users share exported profiles.

Changes

From #4452 (cherry-picked, @dieutx):

  • Added auth.json to _DEFAULT_EXPORT_EXCLUDE_ROOT
  • Named profile exports now use a staged copytree that filters out auth.json and .env
  • Tests for both exclusion set membership and named profile archive contents

Follow-up fix:

  • Added .env to _DEFAULT_EXPORT_EXCLUDE_ROOT (the original PR missed this — default profile exports would still leak .env)
  • Added test for .env in default exclusion set
  • Updated existing test that incorrectly asserted .env presence in exports

Test results

83 profile tests passed + E2E verification of both default and named profile export paths confirming credentials are excluded and legitimate files are preserved.

dieutx and others added 2 commits April 1, 2026 10:48
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.
@teknium1
teknium1 merged commit b267516 into main Apr 1, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants