fix(secrets): 1Password encrypted-only cache; strip OP_* auth from child envs - #77168
Open
andrexibiza wants to merge 1 commit into
Open
fix(secrets): 1Password encrypted-only cache; strip OP_* auth from child envs#77168andrexibiza wants to merge 1 commit into
andrexibiza wants to merge 1 commit into
Conversation
…ild envs The 1Password secret source stored every resolved value in a plaintext disk cache (op_cache.json) at <hermes_home>/cache/ — the same plaintext-at-rest vulnerability class the Bitwarden series (NousResearch#77008) eliminated. The disk cache is now encrypted-only (AES-GCM, op_cache.enc.json, keyed off the auth material; the raw token never touches disk), legacy plaintext is migrated and removed on first read, and cache_ttl_seconds: 0 fully disables cache reuse (fresh fetch every time, nothing on disk). Also closes the child-process leak: OP_SERVICE_ACCOUNT_TOKEN, OP_CONNECT_TOKEN, and every OP_SESSION_* var are stripped from all spawned children via _is_hermes_internal_secret (the op child still receives them explicitly through its own allowlisted env).
This was referenced Aug 3, 2026
Contributor
|
suggesting changes This replay improves 1Password cache protection but is not safe to merge yet. Four source-backed security issues remain:
Security evidence:
Review setup: I reviewed a run-owned local rebase or patch replay against current GitHub Not checked:
Signed: GPT-5.6-luna-max in Codex |
This was referenced Aug 15, 2026
Open
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.
Related #77008 #77027 #77039 #77164
What changed and why
The 1Password secret source stored every resolved value in a plaintext disk cache at
<hermes_home>/cache/op_cache.json— the same plaintext-at-rest vulnerability class the Bitwarden series (#77008) eliminated. The disk cache is now encrypted-only, and 1Password auth material no longer reaches spawned child processes.1. Encrypted-only disk cache (mirrors the Bitwarden #77008 pattern)
op_cache.enc.jsonunder AES-GCM, keyed off the auth material (service-account token,OP_ACCOUNT,OP_CONNECT_*,OP_SESSION_*); the raw token never touches disk — it only derives the key.op_cache.jsonfrom older Hermes versions is migrated into the encrypted cache and removed on first read.cache_ttl_seconds: 0disables cache reuse entirely (fresh fetch every time; nothing read from or written to disk) — and still removes any legacy plaintext file.2. Child-process env hygiene (mirrors the Bitwarden #77027 pattern)
OP_SERVICE_ACCOUNT_TOKEN,OP_CONNECT_TOKEN, and everyOP_SESSION_*var are now stripped from all spawned children via_is_hermes_internal_secret— terminal, browser worker, ACP executor, computer-use driver, TUI/Node host. Previously they leaked to every child by default. Theopchild still receives them explicitly through its own minimal allowlisted env (_op_child_env), which is the one legitimate consumer.3. Tests (5 new, 16 total in the file)
test_disk_cache_is_encrypted_only_no_plaintext— default path writes ONLYop_cache.enc.json; raw secret value absent from the on-disk payload.test_encrypted_cache_round_trip— disk cache serves a second fetch with noop read.test_legacy_plaintext_cache_is_migrated_and_removed— pre-hardening plaintext is re-encrypted and deleted.test_memory_only_mode_removes_legacy_plaintext— ttl 0: fresh fetch, no plaintext consulted, legacy removed.test_clear_caches_removes_encrypted_file.Verification
tests/test_onepassword_secrets.py: 16 passed, 0 failed; withtests/agent/test_secret_scope.py+tests/secret_sources/: 80 passed, 0 failed.OP_ACCOUNT/OP_CONNECT_HOST/PATH/HOMEretained), no blockers, MINOR/NIT only.opchild env allowlist still carriesOP_CONNECT_TOKEN/session vars (its one legitimate consumer), verified end-to-end.Related
OP_*auth vars to_is_hermes_internal_secret; the full provenance-blind scrub — arbitrary non-credential-shaped applied names — remains open).Part of #77473