Nette/Http 3.4.0 introduces UrlValidator and IPAddress classes to protect PHP applications against Server-Side Request Forgery (SSRF) attacks. UrlValidator resolves hostnames to IPs and blocks loopback, private ranges, link-local (including cloud metadata endpoints like 169.254.169.254), multicast, and IANA-reserved addresses. It also provides getResolvedIPs() to pass validated IPs directly to cURL via CURLOPT_RESOLVE, closing the DNS rebinding window. The IPAddress class handles IPv4/IPv6 including IPv4-mapped IPv6 forms that naive checks miss. Version 3.4 also adds Sec-Fetch-* header-based CSRF protection, partitioned cookie support (CHIPS), a SameSite enum, unified cookie expiration handling, and requires PHP 8.3+.
Table of contents
How SSRF Attacks Work in Cloud EnvironmentsHow to Validate URLs in PHPPreventing DNS Rebinding Attacks in PHPValidating IPv4 and IPv6 Addresses in PHPWhat else 3.4 brings1K Impressions