egress: stop screening WebSocket egress (hostname-only check over-promised the control) - #113
Merged
Merged
Conversation
…mised) The WebSocket constructor is synchronous, so the only screen possible inline is a textual hostname match — which can't offer the DNS-resolution guarantee the fetch and node:http/https egress paths provide. A connection-pinning dispatcher could close that, but the server-side attacker-controlled-WebSocket sink is rare, and a partial hostname-only check over-promises the SSRF control. Remove the WebSocket wrapper rather than ship a screen weaker than the one the docs imply. Outbound SSRF screening remains on fetch + node:http/https (node path pinned, fetch resolve-and-screen). The former WS test is replaced with one that pins the decision so a half-guard can't be reintroduced silently. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Intentionally removes WebSocket screening to avoid misleading partial security guarantees 🎯 Quality: 100% Elite · 📦 Size: Small 📈 This month: Your 49th PR — above team average · Averaging Elite |
Contributor
Author
|
/review |
1 similar comment
Contributor
Author
|
/review |
daniloradovic
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the WebSocket egress wrapper. Outbound SSRF screening now covers
fetch+node:http/httpsonly (node path pinned, fetch resolve-and-screen).Why
The
WebSocketconstructor is synchronous, so the only screen possible inline is a textual hostname match — it can't perform the DNS-resolution check thefetchandnode:httppaths do (a hostname that resolves to an internal address would pass a textual check). Bringing WebSocket to parity would require a connection-pinning dispatcher, but:fetch/node:http), andSo rather than keep a half-guard (or ship a runtime-dependent dispatcher for a rare sink), we remove it and screen only the transports we can screen properly. Docs updated to match (no transport claimed that isn't screened).
Tests
The former WebSocket test (which asserted a literal internal host was blocked) is replaced by one that pins the decision — it asserts the guard leaves the global
WebSocketunwrapped — so a half-guard can't be reintroduced silently. Full suite green (647 passing), typecheck clean.