After a page renders an inline fragment, a client can choose the host, scheme and port of every absolute URL your app generates for the rest of that request. Those URLs can end up in pages a shared cache stores, or in emails your app sends, pointing users at the attacker's site.

While an inline fragment ran, Symfony briefly trusted 127.0.0.1 as a proxy. The router rebuilt its settings from the main request during that window, using forwarded headers the client sent.

Who is affected

Apps on symfony/http-kernel (also part of symfony/symfony) that render inline fragments, with render() in Twig or ESI tags without a gateway cache. The app must also be reached over HTTP from 127.0.0.1 without that address in framework.trusted_proxies. The Symfony advisory gives examples: a TLS terminator, reverse proxy, HTTP cache or sidecar on the same host.

Apps served through php-fpm, mod_php, or a proxy on another host aren't affected. With framework.trusted_hosts set, the host can't be changed, but the scheme and port still can.

What to do

Update to 5.4.56, 6.4.50, 7.4.23 or 8.1.11. If you're on 8.0, update to 8.1.11. The fix restores the router's settings after each fragment. Symfony also advises that a proxy on 127.0.0.1 set the forwarded headers itself rather than passing the client's along, and that you set framework.trusted_hosts.

Reported by Nicolas Grekas.