mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
Cost estimation fetches caller-supplied image URLs before any credential is checked, so the node could be aimed at loopback, link-local, and private addresses. Restrict the fetch to globally reachable addresses (RFC 6890), resolve DNS once and validate every returned address, and rewrite plain HTTP to the validated address with the original Host header so a name cannot rebind between the check and the connection. HTTPS keeps its hostname because certificate validation already binds it. Cap the downloaded prefix and the number of URLs one request may fetch.