You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nip05: pin the resolved address for the request and its redirects #1252
From the 2026-11-01 scan: F-004 (low, ssrf, CWE-918), src/utils/nip05.ts. Reachability was not established by the scan.
Current code (main 49f51378): verifyNip05() issues axios.get(url, …) with maxRedirects: 1, maxContentLength/maxBodyLength, and a beforeRedirect that calls isRedirectTargetSafe(href). That guard inspects the URL text — scheme, port, IP literals, hostname shape — not the address the socket actually connects to. A publisher-selected domain that passes the text check but resolves to a private address is still fetched, for the initial request and for a redirect target.
Fix shape
Resolve the hostname inside the request and reject prohibited IPv4/IPv6 results, then bind the connection to the validated address while keeping the Host header and TLS name hostname-based.
Apply the same to a redirect target, because beforeRedirect can replace the resolver.
src/utils/relay-probe/nip11-probe.ts already does this for relay probes — safeNip11Lookup is passed as the request's lookup (fix for F-001). Reuse that shape rather than writing a second one.
Acceptance
A name that resolves to 127.0.0.1, ::1 or an RFC1918 address is refused before a socket opens, for both the initial request and a redirect.
A legitimate NIP-05 endpoint still verifies, including through one safe redirect.
The PR is on my fork: saket0187#2 (commit c10ad6ab). NIP-05 checks now refuse any host or redirect that resolves to a private address, and skip proxies. Could you cherry-pick it when you get a chance? @cameri
Activity
saket0187 commentedon Nov 28, 2026
Could you assign it to me?
saket0187 commentedon Nov 28, 2026
The PR is on my fork: saket0187#2 (commit c10ad6ab). NIP-05 checks now refuse any host or redirect that resolves to a private address, and skip proxies. Could you cherry-pick it when you get a chance? @cameri
saket0187 commentedon Nov 29, 2026
@cameri This one as well. Also, could you please review my PR when you get some free time?