fix(network): recheck resolution freshness at socket use - #54
Draft
seonghobae wants to merge 6 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.
Follow-up to #50 / #47.
Buyer/security gap
The stacked prerequisite #50 removes the ordinary public untimed planning bypass, but its
FreshConnectionPlan::newchecked resolution freshness only when the plan was created. A caller could authorize a plan inside the validity window, delay, and then invoke socket I/O after that authority expired. That preserved a plan-to-connect TOCTOU gap.TDD and RCA evidence
This draft is stacked on exact #50 head
f8b43bc94444986ab23aa4ef3086e446a0b39295.RED was established at exact test-only head
25bcc848b008fef8d3f2bd98de38afafbd10b3b4: repository contracts and rustfmt passed, thencargo check --locked --workspace --all-targetsfailed because the public production boundary had noconnect_atsocket-use freshness recheck.The implementation was then refined after inspecting the existing destination error taxonomy and real first-party TLS consumers. Rather than duplicate freshness errors or leave an unsafe compatibility bypass, current exact head
ec81031c537f2b662910c1ce78c7ae0e0bfc9c1enow:FreshResolutionSnapshotand socket authority inside the single-use plan;connect_at(current_time)so authority-bearing callers re-run destination freshness immediately before socket I/O under the same trusted monotonic clock domain;DestinationError::ResolutionApprovalExpired/ResolutionUseBeforeApprovaloutcomes throughNetworkError::DestinationNotApprovedinstead of inventing a parallel taxonomy;connect()compatibility surface only as a fail-closed path: plan creation anchors a process-local monotonicInstant, and the method adds actual elapsed time to the admitted authorization time before delegating toconnect_at, so delayed legacy callers cannot replay a stale plan indefinitely; andNo DNS lookup, hostname reconnect, ambient proxy/PAC, or wall-clock authority was added.
Exact-head evidence
On unchanged exact head
ec81031c537f2b662910c1ce78c7ae0e0bfc9c1eagainst exact prerequisite #50 headf8b43bc94444986ab23aa4ef3086e446a0b39295:31418337788: success;cargo fmt --all --check: success;No predecessor-head result is transferred to this exact head.
Scope boundary
No resolver adapter, DNS lookup, wall-clock clock source, proxy/PAC, TLS policy change, HTTP, browser control, persistence, secret, model call, workflow mutation, or release claim is introduced. The explicit path still requires one caller-owned trusted monotonic clock domain; the compatibility path uses only a process-local monotonic elapsed-time anchor to prevent stale replay.
Keep Draft while #50 and #47 remain active. Canonical whole-product documentation remains owned by PR #44; this active PR must not be described as protected-main shipped truth.