Skip to content

Refuse bundles whose session id isn't a plain file name; pin Codex review findings - #8

Merged
frenchie4111 merged 2 commits into
mainfrom
fix/codex-review-findings
Nov 20, 2026
Merged

frenchie4111 merged 2 commits into
mainfrom
fix/codex-review-findings

Conversation

@frenchie4111

Copy link
Copy Markdown
Contributor

Triage of the four open review comments on #5's Codex support.

Fixed: a bundle's session id chose where restore wrote. Both adapters join the id into the restored transcript's path, so a crafted bundle with ../../x or /x wrote outside the agent's session directory (reproduced). The id also went unquoted into resumeCommand. agent::is_safe_session_id ([A-Za-z0-9._-], at most 128 bytes, no leading .) is now checked on unpack, so such a bundle is bundle-unreadable, and in both find_transcripts, whose ids come from edit records in the same shared store. The bad id is never echoed back.

Pinned, not fixed:

  • SessionEnd killed 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-turn on 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.
  • One directory recorded two ways (resolved, and -C through a link): reported in otherCwds, 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

frenchie4111 and others added 2 commits November 20, 2026 11:49
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>
@frenchie4111
frenchie4111 merged commit a61abc0 into main Nov 20, 2026
2 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.

1 participant