Skip to content

fix(shared): reject corrupted T3 Connect authorization links - #11364

Open
shivamhwp wants to merge 1 commit into
fix/client-device-ticket-http-groupfrom
fix/shared-connect-fragment-validation
Open

fix(shared): reject corrupted T3 Connect authorization links#11364
shivamhwp wants to merge 1 commit into
fix/client-device-ticket-http-groupfrom
fix/shared-connect-fragment-validation

Conversation

@shivamhwp

@shivamhwp shivamhwp commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Corrupted t3 connect links currently proceed through browser authorization and fail only when the CLI receives the code. Validate the state and PKCE challenge against the canonical base64url forms generated by the CLI before starting authorization. Both loopback and headless flows use this parser.

Closes #4934. The existing invalid-link page asks users to run t3 connect again.

Validation: 24 focused shared tests pass; both corruption regressions fail before the fix. Targeted lint, formatting and diff checks pass. Internal Fable refinement remains pending.

Stacked on #11298; this PR changes only the shared parser and its tests.

Model and harness: GPT-6 through Codex.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 12, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The production change alters validation in the shared T3 Connect authorization flow, determining which browser links may proceed to Clerk authorization. Although the implementation and tests are narrowly scoped, authentication-sensitive behavior requires human review.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 66.4 KiB
Codex Live turn messages 10 21
Claude Total thread wire 13.6 KiB 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 66.4 KiB
Claude Live turn messages 9 21

Baseline: unavailable · PR result: 4e60b59 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@greatitself

Copy link
Copy Markdown

Independent validation of 4e60b590364e1c40417155de61a4b8e59b85b0f3 (merge-base 050e2cafb144).

Exercised the unused base64url bits systematically: 256 valid state/challenge pairs all round-tripped. For each pair, changed only unused bits in the final character: 15 state variants and 3 challenge variants. This revision rejected all 4,608 noncanonical variants; the merge-base accepted them. This is URL-parser validation, not an end-to-end authorization test.

Reproduction scripts and recorded resultsfirst.mjs; the numbered metadata file pins this PR’s tested revisions.

Model: GPT-6. Harness: Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants