Skip to content

Support trusted headers for remote exec WebSockets - #42606

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/f2e2b0456c8e33c13fd8ab4ee040a8b5c15e885d
Sep 3, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/f2e2b0456c8e33c13fd8ab4ee040a8b5c15e885d

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 3, 2026

Copy link
Copy Markdown

Support trusted headers for remote exec WebSockets

What changed

  • Add RemoteEnvironmentOptions and upsert_environment_with_options so embedding hosts can attach trusted HTTP headers to remote exec-server WebSocket handshakes.
  • Preserve the headers across session reconnects while redacting them from debug output.
  • Reject invalid, duplicate, and WebSocket-controlled headers, and require wss:// for non-loopback destinations.
  • Connect header-bearing loopback WebSockets directly, with DNS results restricted to loopback addresses.

Testing

  • Cover header validation and redaction, delivery on initial connections and reconnects, and loopback destination enforcement.

## What changed

- Add `RemoteEnvironmentOptions` and `upsert_environment_with_options` so embedding hosts can attach trusted HTTP headers to remote exec-server WebSocket handshakes.
- Preserve the headers across session reconnects while redacting them from debug output.
- Reject invalid, duplicate, and WebSocket-controlled headers, and require `wss://` for non-loopback destinations.
- Connect header-bearing loopback WebSockets directly, with DNS results restricted to loopback addresses.

## Testing

- Cover header validation and redaction, delivery on initial connections and reconnects, and loopback destination enforcement.

GitOrigin-RevId: f2e2b0456c8e33c13fd8ab4ee040a8b5c15e885d
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/f2e2b0456c8e33c13fd8ab4ee040a8b5c15e885d branch from 02a3661 to 801ca0d Compare September 3, 2026 20:02
@copyberry
copyberry Bot merged commit 801ca0d into main Sep 3, 2026
25 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/f2e2b0456c8e33c13fd8ab4ee040a8b5c15e885d branch September 3, 2026 20:03
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 3, 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.

1 participant