Symfony HttpFoundation: Crafted Links Make Generated URLs Point Elsewhere
Lets a crafted link make an app's links, forms and redirects point to another host, when its front controller sits in a subdirectory.
Are you affected?
Only if both are true.
1Your front controller sits in a subdirectory, such as public/, and the web server sends it paths that don't start with that directory, as a root .htaccess that rewrites every URL to public/ does.
2symfony/http-foundation (or one of the 1 other affected package below) is below 8.1.11 on 8.1.x, below 7.4.23 on 7.4.x, below 6.4.50 on 6.4.x, below 5.4.56 on 5.4.x, or on an older branch.
Fix it
Find the branch you run and update to the release next to it.
The same releases fix symfony/http-foundation and symfony/symfony; update whichever you install.
If you run 8.1.0 – 8.1.10Update to 8.1.11
composer require symfony/http-foundation:^8.1.11
If you run 7.4.0 – 7.4.22Update to 7.4.23
composer require symfony/http-foundation:^7.4.23
If you run 6.4.0 – 6.4.49Update to 6.4.50
composer require symfony/http-foundation:^6.4.50
If you run 5.4.0 – 5.4.55Update to 5.4.56
composer require symfony/http-foundation:^5.4.56
On an older branch? Show 32 branches that are no longer supported
These branches no longer get security fixes, so the next flaw won't be patched on them.
Plan a move to a supported one.
If you run 8.0.0 – 8.0.xUpdate to 8.1.11
composer require symfony/http-foundation:^8.1.11
If you run 7.0.0 – 7.0.xUpdate to 7.4.23
composer require symfony/http-foundation:^7.4.23
If you run 7.1.0 – 7.1.xUpdate to 7.4.23
composer require symfony/http-foundation:^7.4.23
If you run 7.2.0 – 7.2.xUpdate to 7.4.23
composer require symfony/http-foundation:^7.4.23
If you run 7.3.0 – 7.3.xUpdate to 7.4.23
composer require symfony/http-foundation:^7.4.23
If you run 6.0.0 – 6.0.xUpdate to 6.4.50
composer require symfony/http-foundation:^6.4.50
If you run 6.1.0 – 6.1.xUpdate to 6.4.50
composer require symfony/http-foundation:^6.4.50
If you run 6.2.0 – 6.2.xUpdate to 6.4.50
composer require symfony/http-foundation:^6.4.50
If you run 6.3.0 – 6.3.xUpdate to 6.4.50
composer require symfony/http-foundation:^6.4.50
If you run 2.0.0 – 2.0.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 2.1.0 – 2.1.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 2.2.0 – 2.2.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 2.3.0 – 2.3.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 2.4.0 – 2.4.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 2.5.0 – 2.5.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 2.6.0 – 2.6.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 2.7.0 – 2.7.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 2.8.0 – 2.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 3.0.0 – 3.0.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 3.1.0 – 3.1.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 3.2.0 – 3.2.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 3.3.0 – 3.3.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 3.4.0 – 3.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 4.0.0 – 4.0.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 4.1.0 – 4.1.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 4.2.0 – 4.2.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 4.3.0 – 4.3.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 4.4.0 – 4.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 5.0.0 – 5.0.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 5.1.0 – 5.1.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 5.2.0 – 5.2.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
If you run 5.3.0 – 5.3.xUpdate to 5.4.56
composer require symfony/http-foundation:^5.4.56
What an attacker can do
A crafted link to your app can make the page it opens point its links, form actions, redirects and assets at another host. A login form could then send a user's password to the attacker, or the page could load the attacker's scripts. The attacker needs a user to follow that link.
Request::getBaseUrl() looks for the front controller's name further into the path when it isn't at the start, to support front controllers in a subdirectory. It kept everything before that name, which the client chooses, and that part could start with a host. Every URL built from the base URL then pointed there. See the Symfony advisory.
The advisory also lists servers that set SCRIPT_NAME to the request path, such as some nginx setups without fastcgi_split_path_info, and php -S with a router script outside the document root. The server setups recommended in Symfony's docs aren't affected. framework.trusted_hosts doesn't help, because the request's real host is unchanged.
The fix returns an empty base URL for these requests, so generated URLs stay on your host.
Reported and fixed by Nicolas Grekas.
Not sure? Check your app with an agent
Paste this into a coding agent that can read your project, such as Claude Code, Codex or Amp.
It checks your composer.lock against the versions above and tells you what to update, without changing anything.
Check whether the PHP project you have access to is affected by this security advisory, and tell me what to update. Do a read-only check: don't edit files, don't run composer update or composer require, and don't try to reproduce the flaw.
Advisory: Symfony HttpFoundation: Crafted Links Make Generated URLs Point Elsewhere (CVE-2026-135802)
Details: https://phpnews.net/security/symfony/cve-2026-135802
Affected versions, as Composer constraints:
- symfony/http-foundation, symfony/symfony: >=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.4.0|>=2.4.0,<2.5.0|>=2.5.0,<2.6.0|>=2.6.0,<2.7.0|>=2.7.0,<2.8.0|>=2.8.0,<3.0.0|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.3.0|>=3.3.0,<3.4.0|>=3.4.0,<4.0.0|>=4.0.0,<4.1.0|>=4.1.0,<4.2.0|>=4.2.0,<4.3.0|>=4.3.0,<4.4.0|>=4.4.0,<5.0.0|>=5.0.0,<5.1.0|>=5.1.0,<5.2.0|>=5.2.0,<5.3.0|>=5.3.0,<5.4.0|>=5.4.0,<5.4.56|>=6.0.0,<6.1.0|>=6.1.0,<6.2.0|>=6.2.0,<6.3.0|>=6.3.0,<6.4.0|>=6.4.0,<6.4.50|>=7.0.0,<7.1.0|>=7.1.0,<7.2.0|>=7.2.0,<7.3.0|>=7.3.0,<7.4.0|>=7.4.0,<7.4.23|>=8.0.0,<8.1.0|>=8.1.0,<8.1.11
Fixed releases on branches that still get security fixes:
- 8.1.0 – 8.1.10: update to 8.1.11
- 7.4.0 – 7.4.22: update to 7.4.23
- 6.4.0 – 6.4.49: update to 6.4.50
- 5.4.0 – 5.4.55: update to 5.4.56
An app is exposed only if all of these are true, besides running an affected version:
- Your front controller sits in a subdirectory, such as `public/`, and the web server sends it paths that don't start with that directory, as a root `.htaccess` that rewrites every URL to `public/` does.
1. Find every composer.lock in the project outside vendor/ (a monorepo can have one per app) and read the installed version of each package above. Packages installed as dependencies of other packages count too.
2. Compare each installed version with its constraint: "|" separates alternative ranges, and "," means both bounds apply.
3. For each affected install, check whether the project meets every condition listed above. Say which conditions you could check and which you couldn't.
4. Report a table: lock file | package | installed version | affected (yes, no or unknown) | conditions met (yes, no or unknown) | update to | evidence. For each affected package, give the command that would fix it, without running it: composer update <package> --with-dependencies when it is only installed as a dependency of another package, or composer require with the fixed version when composer.json requires it directly. If the installed version is on a branch with no fixed release listed, say it needs a move to a newer branch.
Check whether the PHP project you have access to is affected by this security advisory, and tell me what to update. Do a read-only check: don't edit files, don't run composer update or composer require, and don't try to reproduce the flaw.