fix(assistants): reject run-step identity hijacking before tool callbacks - #2476
fix(assistants): reject run-step identity hijacking before tool callbacks#2476HAYDEN-OAI wants to merge 3 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Castiron custom code✅ No new custom-code files detected. 32 mixed files remain; 0 existing customizations changed. Compared 32 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 32903817290 --repo openai/openai-node \
--name castiron-custom-code-32903817290-1 --dir /tmp/castiron-custom-code-32903817290-1
git apply --stat /tmp/castiron-custom-code-32903817290-1/custom-code.patch
cat /tmp/castiron-custom-code-32903817290-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 9dd86484d9d5a2212ea8ec472fad6f76c747ba14 3253164713e440d83b09d634a43c1527c5246e70
python3 scripts/castiron/custom_code_report.py report \
--base 9dd86484d9d5a2212ea8ec472fad6f76c747ba14 \
--head 3253164713e440d83b09d634a43c1527c5246e70 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-3253164713e4
cat /tmp/castiron-custom-code-3253164713e4/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb42bbc222
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Requesting changes for the existing P1 discussion at src/lib/AssistantStream.ts:463. A public generic event listener can mutate the retained currentRunStepSnapshot().id from active step B to an already-completed step A after event.data has been validated. #handleRunStep then emits privileged toolCallCreated/toolCallDelta/runStepDelta callbacks against the hijacked identity, and the retained-snapshot ownership check rejects only after those irreversible callbacks have already run. Revalidate the retained active snapshot and its canonical owner immediately after generic event emission and before any callback-producing handler; add a two-step A/B mutating-listener regression proving that no tool callback executes. Existing inline discussion already captures the blocker.
Summary
AssistantStream.fromReadableStream()NDJSON transport and the existing streaming helper.Validation
main; all 27 new assertions now pass.publint, and packed-package verification passed.AssistantStreamexports both reject the original duplicate-ID attack before exposing its attacker-controlled callback or snapshot.