fix(network): bind socket port to canonical origin - #167
Draft
seonghobae wants to merge 27 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Partial hardening of the direct-network authority stack, stacked on exact PR #54 head
8b8a5b443ad4620613b79f381db3fbe4d5a5f994.Buyer/security and reliability gaps
A fresh resolution approves an exact address, not every service port on that address.
FreshConnectionPlantherefore binds the requested socket port to the canonical origin's effective HTTP/HTTPS port. During this pass two adjacent malformed-input ordering defects were also proven and fixed:OriginPortMismatchinstead ofInvalidPort; andLive dependency alignment
This branch remains non-destructively aligned with exact #54 head
8b8a5b443ad4620613b79f381db3fbe4d5a5f994. Current exact contributor head is63576fb8e6594b47db2b0de6244b262f0aebc401; GitHub reports the Draft mergeable. Keep Draft while #54/#50/#47 remain active. No prerequisite check, review, mergeability, or approval evidence transfers.Test-first RCA and remedy
0d0fbba7fc42d31cc3b2b0d8f6f9d2eab742b968passed setup boundaries then failed in CI31939622147because the result was notNetworkError::InvalidPort. Production moved malformed zero-port validation ahead of resolution/origin authority.8d27a44b4e9f2cc206f45d31016f9853c2ce7f75required zero timeout and zero attempt count to fail before both wrong-origin-port and unapproved-address state. CI31940046251reached those focused tests and proved the malformed settings were being masked by authority decisions.ConnectionPlanbefore resolution authorization and port matching. An intermediate head passed semantics but exposed canonical rustfmt and one exact branch-coverage gap.FreshConnectionPlan::new: zero andMAX_CONNECT_TIMEOUT + 1ns, plus zero andMAX_CONNECTION_ATTEMPTS + 1. No production gate or limit was weakened.The final constructor order is input shape (port, timeout, attempts) → fresh-resolution authorization → canonical origin-port equality → exact
ConnectionPlancreation. It still performs no DNS lookup or socket I/O during admission.Exact-current proof
On unchanged exact head
63576fb8e6594b47db2b0de6244b262f0aebc401:31940961006: success;Rust contracts: repository contracts, canonical formatting, locked workspace/all-target checks, full tests, strict Clippy, and rustdoc success under Rust 1.97.1;Production coverage: exact owned production function/line/region/branch enforcement success;Security/SAST/central/model workflows not returned for this stacked Draft are absent and are not represented as passing. No predecessor-head, prerequisite-head, queued, skipped, cancelled, stale, synthetic, status-only, or model-only evidence is promoted.
Truth boundary
This is deterministic plan admission and error-classification hardening only. It performs no DNS lookup, socket I/O before admission, TLS/HTTP exchange, proxy/PAC selection, persistence, secret/model work, or release action. Later integrated paths must still compose exact peer verification, TLS identity, HTTP authority, browser policy, and post-condition evidence. The scheduled actor does not merge or self-approve.