Symfony's NoPrivateNetworkHttpClient is meant to stop your app from making requests to private networks. A gap in it lets an attacker who controls a domain's DNS find out which internal hosts and ports are open.

The client checked a host's IP address the first time it looked the host up. On later requests to the same host, it let the lookup happen again without pinning the checked address. DNS rebinding (a DNS server answering with a public IP first and a private one later) takes advantage of that. The request is still stopped before anything is sent, but the connection is made, and the error differs depending on whether the port is open. This is an incomplete fix for CVE-2024-50342. See the Symfony advisory and the fix.

Who is affected

Apps that use NoPrivateNetworkHttpClient to fetch URLs that users supply, and send several requests to the same host through the same client. Symfony's example is an app that fetches several URLs from a repository a user provides.

Apps that don't use NoPrivateNetworkHttpClient aren't affected. The attacker learns which internal ports are open, not what is behind them, which is why the CVSS score is 2.3 (low).

What to do

Update symfony/http-client (or symfony/symfony) to 5.4.56, 6.4.50, 7.4.23 or 8.1.11, depending on your branch.

Reported by Eirik Stanghelle Morland of Packagist.