Domain lookup: harden core whois/RDAP (referral SSRF, resolver isolation, structured errors) #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from the Codex review of
api/v2/domains_lookup.php(the app's domain auto-fill). The endpoint wraps coregetDomainRecords()infunctions.php, which the web UI already exercises, so these are inherited-from-core, not new to the API. The endpoint itself was hardened (IP-literal rejection, per-token throttle, normalisation).Remaining, in core
functions.php:CURLPROTO_HTTPSrestricts the scheme, not the destination. Fix: follow redirects manually and validate every hop's resolved IP against a deny-list of internal ranges; resolve+validate whois referral hosts before connecting. (Responses aren't dereferenced, so no data-exfil SSRF — but connections still occur.) An egress firewall is the pragmatic defence-in-depth.getDomainRecords()distinguish authoritative no-data from upstream failure; surface 502/504.functions.php:1372) — fetched but never used.Scope note: proper fixes need a PSL library + isolated resolver + manual redirect validation in core; deferred to keep fork↔core divergence minimal (the web UI has the same exposure today).