Skip to content

fix(ui): block browser forwarding of CLI OAuth callback states#6

Open
mosure wants to merge 1 commit into
mainfrom
codex/fix-raw-oauth-handoff-vulnerability
Open

fix(ui): block browser forwarding of CLI OAuth callback states#6
mosure wants to merge 1 commit into
mainfrom
codex/fix-raw-oauth-handoff-vulnerability

Conversation

@mosure

@mosure mosure commented May 4, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Prevent the browser-side OAuth callback handoff from forwarding attacker-controlled CLI OAuth state to the edge, which could enable session token exfiltration via malicious redirect URIs.
  • Ensure browser forwarding only occurs for trusted feed:-encoded OAuth state that does not indicate a CLI client.

Description

  • Tightened forwardRawGithubOauthCallback in crates/agent_feed_ui/src/reel.ts to decode the state value and refuse forwarding when it is not a decodable feed: payload or when the decoded client ends with -cli.
  • Added decodeFeedOauthStateClient helper to safely parse the feed: hex-encoded JSON state and extract the client field, failing closed on malformed values.
  • Updated UI snapshot/assertion expectations in crates/agent_feed_ui/src/lib.rs to reflect the new guard logic and helper function.

Testing

  • Ran the UI unit test suite with cargo test -p agent_feed_ui --ignore-rust-version, iterating until expectations matched the updated output.
  • Final automated test run succeeded: all UI tests passed (29 passed; 0 failed).

Codex Task

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant