Skip to content

fix(exec-server): reject websocket requests with Origin headers#24947

Merged
viyatb-oai merged 1 commit into
mainfrom
codex/viyatb/bugb-17613-exec-server-origin-guard
May 28, 2026
Merged

fix(exec-server): reject websocket requests with Origin headers#24947
viyatb-oai merged 1 commit into
mainfrom
codex/viyatb/bugb-17613-exec-server-origin-guard

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

Why

codex exec-server has a local WebSocket listener, but it did not apply the same browser-origin request handling as the app-server WebSocket transport. Requests that carry an Origin header should not be upgraded by this local transport, keeping both local WebSocket servers consistent and avoiding unexpected browser-initiated connections.

What changed

  • Added an Axum middleware guard in codex-rs/exec-server/src/server/transport.rs that returns 403 Forbidden for requests carrying an Origin header.
  • Added an integration test in codex-rs/exec-server/tests/websocket.rs that covers rejection of an Origin-bearing WebSocket handshake.
  • Kept ordinary WebSocket clients unchanged: existing no-Origin initialization and process behavior remains covered by the crate tests.

Validation

  • just test -p codex-exec-server test phase (186 passed; run outside the parent macOS sandbox so nested sandbox tests can execute)
  • just clippy -p codex-exec-server

@viyatb-oai viyatb-oai marked this pull request as ready for review May 28, 2026 18:54
@viyatb-oai viyatb-oai merged commit a027135 into main May 28, 2026
31 checks passed
@viyatb-oai viyatb-oai deleted the codex/viyatb/bugb-17613-exec-server-origin-guard branch May 28, 2026 21:44
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants