fix: guarded fetch falls back to IPv6 when IPv4 is unreachable#110124
fix: guarded fetch falls back to IPv6 when IPv4 is unreachable#110124an2in wants to merge 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 3:26 PM ET / 19:26 UTC. Summary PR surface: Source +4, Tests +3. Total +7 across 2 files. Reproducibility: yes. at source level: Node requests all addresses for Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Accept the smallest dual-stack policy that returns only the already SSRF-validated address set for Do we have a high-confidence way to reproduce the issue? Yes at source level: Node requests all addresses for Is this the best way to solve the issue? Yes, conditionally: returning the existing validated record set only for the dependency’s AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1d999b817fac. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +3. Total +7 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review Exact-head dual-stack runtime proof for both asymmetric route directions and the successful secretless full-CI run have been added to the PR body. The PR remains draft for maintainer/security policy review. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Closes #87763
What Problem This Solves
Fixes an issue where guarded provider requests on dual-stack hosts can fail when IPv4 is unreachable even though IPv6 is available.
Why This Change Was Made
Single-address pinned lookups remain IPv4-only when IPv4 records exist, preserving the behavior introduced for #80078. All-record lookups used by Node/Undici Happy Eyeballs now receive the complete SSRF-validated, IPv4-first pinned record set, so IPv6 remains available as a fallback. Explicit-family and hostname-fallback behavior are unchanged.
User Impact
Users on networks where a provider's IPv4 route is unavailable but IPv6 works can complete guarded provider requests without disabling DNS pinning or weakening resolved-address checks.
Evidence
src/infra/net/ssrf.pinning.test.tsproves:{ all: true }returns IPv4 and IPv6 in IPv4-first order;git diff --checkpasses.fdea545196ae73695d1fc6fe54c1252af8c4374b: 125 jobs passed and 6 scope-inapplicable jobs skipped. The network/security test shard, build artifacts, lint, production types, andopenclaw/ci-gateall passed.Exact-head dual-stack runtime proof
The following redacted
NODE_DEBUG=netexcerpts came from disposable Node 24 containers on an Ubuntu 24.04.4 VM. Both containers checked out exact headfdea545196ae73695d1fc6fe54c1252af8c4374band invokedfetchWithSsrFGuardfrom that checkout. No API key or authorization header was supplied; the containers received onlyPROOF_SHAandNODE_DEBUGas environment variables.IPv4 unreachable, IPv6 succeeds (
https://openrouter.ai/api/v1/models, host networking):IPv6 unreachable, IPv4 succeeds (
https://www.google.com/generate_204, IPv4-only Docker bridge):The original shipped-version observation is consistent with the exact-head proof: on Ubuntu 24.04.4 LTS with Node v24.15.0 and OpenClaw 2026.5.26, direct IPv6 worked while guarded IPv4 timed out; retaining the validated IPv6 candidate restored the provider request.
AI-assisted: Codex helped diagnose, implement, and review this change. I reviewed the code and understand the behavior. The original diagnostic transcript is not attached because it contained credentials; the exact-head proof above was rerun without credentials and is sanitized.