Skip to content

Add Origin header validation to CDP proxy WebSocket server#2668

Open
lucygramley wants to merge 2 commits into
microsoft:masterfrom
lucygramley:fix/cdp-proxy-origin-validation
Open

Add Origin header validation to CDP proxy WebSocket server#2668
lucygramley wants to merge 2 commits into
microsoft:masterfrom
lucygramley:fix/cdp-proxy-origin-validation

Conversation

@lucygramley
Copy link
Copy Markdown
Contributor

Reject WebSocket connections that include an Origin header in the CDP proxy. Only the raw vscode-js-debug WebSocket client should connect to the proxy, and it does not send an Origin header.

Reject WebSocket connections that include an Origin header, as only the raw vscode-js-debug client should connect to the CDP proxy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@joj joj enabled auto-merge May 27, 2026 23:10
@ConnorQi01
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ConnorQi01
Copy link
Copy Markdown
Collaborator

ConnorQi01 commented May 28, 2026

Hi @lucygramley

Thanks for the contribution and for the CDP proxy hardening work here.

Could you please create or link a corresponding issue for this PR? It would help us track the security motivation, affected surface, and expected client behavior separately from the implementation.

Also, the PR validation is currently failing on Linux, Windows, and macOS in the unit test pipeline. Could you please take a look at the failing test logs and update the PR accordingly?

For this change specifically, it would be helpful to confirm that rejecting every WebSocket connection with an Origin header does not break any supported local debugging flow. A small test or validation note for the expected vscode-js-debug connection behavior would make the review much easier.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants