Repository navigation
fix: validate WebSocket 101 acceptance before bridging - #14
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e0e49ce15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Fixes #6
Stacked on PR #13 (setup deadlines and cleanup); review/merge #13 first, then retarget this PR to main if GitHub does not do so automatically. This diff only adds handshake verification and fixture/regression updates.
Retain each random request key and validate the RFC 6455 Accept hash, structured HTTP/1.1 status, case-insensitive Upgrade and Connection fields, requested subprotocol, and absence of unrequested extensions. Reject duplicate Accept/subprotocol, malformed headers, folded fields, and misleading status text. Invalid 101 responses release neither downstream 101/payload nor client payload and start no frame worker. Non-101 HTTP/1.0 and HTTP/1.1 rejections remain forwarded. Status controls and non-ASCII Connection-token whitespace are rejected.
Fixtures now derive valid Accept from the actual outbound request nonce. Coverage includes the RFC known vector, missing/wrong/duplicate headers, unexpected subprotocol/extensions, header case, Connection token lists/repeated fields, optional subprotocol, control/DERP payload, ping/pong, close/EOF and long-lived streams. Based on RFC 6455 section 4.1: https://www.rfc-editor.org/rfc/rfc6455.html#section-4.1
Local: 38 focused shim tests pass. Full 71-test suite: 70 pass, one existing AF_UNIX sandbox restriction. CI runs Python 3.11/3.13 and ShellCheck. No live installation, proxy, credentials, network or deployment changes.
Verified CI on head
9e0e49ce1576a50b02c108fc8d9e2d9054aca5c1: Python 3.11 and 3.13, 71 tests each, plus Bash syntax and ShellCheck passed. Workflow run.Codex review follow-up
The Python 3.8 compatibility finding is fixed with a guarded SHA-1 keyword fallback. Fixtures exercise old and modern constructors; timeout assertions account for Python 3.8's distinct socket.timeout class. All 40 focused shim tests pass on actual Python 3.8.20 and 3.13.7. Base is now main after PR #13 was merged; no unrelated transport changes were added. Latest head has been submitted for another Codex review.