Repository navigation
Confine provider transcript reads to each egg's recorded session - #28
Merged
Merged
Conversation
…review bindings survive
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.
Security fixes for shared roosts, found by adversarial review of
harden/alland reproduced on main8cf1360by the new tests.1. Cross-user transcript read. On a shared roost (several users, one OS account, per-user provider homes), a caller who knew another user's Claude provider session ID could replace their own writable
.claude/projects/<encoded-CWD>or hook directory with a symlink to the victim's.session_read, the conversation views and history capture then imported the victim's messages into the caller's journal.Fix: transcript and hook discovery, imports, history capture, restore, resume and fork walk the pinned provider home component by component with
O_NOFOLLOWand read through descriptors. They accept only provider IDs the egg itself recorded: the launch binding, or a laterSessionStartfrom its own hook spool, so/clearand/resumekeep working.2. Cross-user settings read.
--settings .../alias/.credentials.json, wherealiaslinks into another user's provider home, copied that file intoclaude-settings.json, which is readable inside the caller's sandbox.Fix: settings reads are authorized against the compiled session policy and traversed with pinned no-follow descriptors. Directory symlinks and hardlinks are refused.
Behavior changes worth a look:
/clearuses the current conversation. Before this PR's own fix it would have been refused; a live fork after/resumecarries the current conversation (it used the launch one on main).docs/security.md: archives captured by pre-upgrade eggs are unverified, and how to remove them.Evidence:
internal/egg/transcript_confinement_test.go, settings and fork/resume tests) fail on8cf1360and pass here.739af48.551333cand739af48.