Repository navigation
Refuse bundles whose session id isn't a plain file name; pin Codex review findings - #8
Merged
Merged
Conversation
A session id from a bundle was joined into the restored transcript's path, so a crafted bundle could write anywhere (`../../x`, `/x`) and inject into resumeCommand. Bundles come from shared stores, so the id is now checked on unpack (bundle-unreadable) and in both find_transcripts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…red) - SessionEnd killed at Codex's 3s while the store hangs: the turn is already closed locally; the store copy and the state cleanup are lost. - ask --at-turn on a turn before a move: the fork keeps naming that turn's cwd, which Codex's resume then offers as the session directory. - One directory recorded two ways (resolved, and -C through a link): reported as otherCwds, and only one spelling is rewritten on restore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Triage of the four open review comments on #5's Codex support.
Fixed: a bundle's session id chose where
restorewrote. Both adapters join the id into the restored transcript's path, so a crafted bundle with../../xor/xwrote outside the agent's session directory (reproduced). The id also went unquoted intoresumeCommand.agent::is_safe_session_id([A-Za-z0-9._-], at most 128 bytes, no leading.) is now checked on unpack, so such a bundle isbundle-unreadable, and in bothfind_transcripts, whose ids come from edit records in the same shared store. The bad id is never echoed back.Pinned, not fixed:
SessionEndkilled at Codex's 3s while the store hangs: the turn is already closed locally, and only the store copy is lost. This test passes. Explicit push removes the cause.ask --at-turnon a turn from before a move: the fork names that turn's cwd, which Codex 0.166's resume then offers as the session directory. Ignored test.-Cthrough a link): reported inotherCwds, and only one spelling is rewritten on restore. Two ignored tests.Run the ignored ones with
cargo test --release --test codex -- --ignored.🤖 Generated with Claude Code