Repository navigation
fix(grader): repair undici lookup callback shape for Node 22+ HTTPS targets - #1026
Conversation
…robe
On Node 22+ with HTTPS targets, undici calls connect.lookup with
{ all: true } and expects the array form cb(null, [{address, family}]).
The probe was passing the single-value form cb(null, address, family),
producing "Invalid IP address: undefined" against anycast/Cloudflare
endpoints. Aligns the callback with the pattern in ssrf-fetch.ts and
preserves DNS-rebinding protection.
Closes #1025
https://claude.ai/code/session_01648bZhu2JMjvS7WC949n2J
…robe URL.hostname wraps IPv6 literals in brackets (`[::1]`); dns.lookup and the address classifiers need the bare form. Mirrors the pattern already used in ssrf-fetch.ts. https://claude.ai/code/session_01648bZhu2JMjvS7WC949n2J
|
Independent expert pass (code-reviewer + security-reviewer) — both ship-ready, no blockers, aligned with triage's pre-PR review. Code review: clean. Confirmed dual-shape callback is correct ( Security review: ship. Verified the four key concerns:
Net: patch correct, threat model preserved, audience-appropriate. Triage's pre-PR review held up under independent verification. Ready to merge. Once #1026 lands, the auto-Release-PR will sit at 5.21.1 (one patch changeset queued). |
Patch picks up the grader fix from adcontextprotocol/adcp-client#1026 (closes my-filed #1025 — undici lookup callback shape broke against Cloudflare-fronted endpoints). Validated end-to-end after deploy: npx adcp grade request-signing https://agenticadvertising.org/api/training-agent/mcp-strict --transport mcp --skip-rate-abuse → 30 passed, 3 failed, 6 skipped (was 1 passed pre-fix, all 32 others blocked at "fetch failed") The 3 remaining failures are verifier-side conformance gaps in the training-agent's strict route, unrelated to this bump: - neg/007 missing-content-digest: strict capability is 'either', not 'required' - neg/016 replayed-nonce: replay store doesn't reject duplicate nonce - neg/018 digest-covered-forbidden: 'either' too permissive for vector Runtime API surface unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Patch picks up the grader fix from adcontextprotocol/adcp-client#1026 (closes my-filed #1025 — undici lookup callback shape broke against Cloudflare-fronted endpoints). Validated end-to-end after deploy: npx adcp grade request-signing https://agenticadvertising.org/api/training-agent/mcp-strict --transport mcp --skip-rate-abuse → 30 passed, 3 failed, 6 skipped (was 1 passed pre-fix, all 32 others blocked at "fetch failed") The 3 remaining failures are verifier-side conformance gaps in the training-agent's strict route, unrelated to this bump: - neg/007 missing-content-digest: strict capability is 'either', not 'required' - neg/016 replayed-nonce: replay store doesn't reject duplicate nonce - neg/018 digest-covered-forbidden: 'either' too permissive for vector Runtime API surface unchanged. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Closes #1025
On Node 22+ with HTTPS targets, undici calls
connect.lookupwith{ all: true }and expects the array form of the callback (cb(null, [{address, family}])). The request-signing probe was using the single-value form (cb(null, address, family)), producing "Invalid IP address: undefined" on every probe against any endpoint behind Cloudflare or an anycast load balancer — makingadcp grade request-signingcompletely non-functional against production deployments. The fix aligns the callback with the already-working pattern insrc/lib/net/ssrf-fetch.tsand preserves the DNS-rebinding protection. Also fixes a pre-existing gap: IPv6-literal hostnames were not bracket-stripped beforedns.lookup, mirroring the same one-liner fromssrf-fetch.ts.What was tested:
npm run format:check— passednpm run typecheck— pre-existing@types/node/moduleResolutiondeprecation errors only; no new errors introduced (verified by stashing the change and comparing)npm run build:lib— blocked by missingtsxin this environment (pre-existing); TypeScript compilation of the changed file passes with no new errorsnpm test— 603 failures vs. 608 baseline (5 fewer failures, no regressions introduced)Pre-PR review:
pinnedFamilynarrowing present; IPv6 bracket stripping added; nit noted (body-truncation early-return pre-exists, out of scope)isAlwaysBlocked,isPrivateIp,redirect: manual, body cap) all intact; IP-in-error-message divergence fromssrf-fetch.tsnoted as low-risk nit for this tool contextNit (not fixed, low risk):
probe.tsincludes the resolved IP address directly inresult.errorstrings (lines 81–92).ssrf-fetch.tsintentionally omits the IP from human-readable messages to avoid leaking internal topology into compliance reports. For a CLI grader whose output stays on the operator's terminal this is low risk, but worth aligning in a follow-up.Session: https://claude.ai/code/session_01648bZhu2JMjvS7WC949n2J
Generated by Claude Code