CVE-2026-45072 Symfony: Stored XSS in WebProfiler CodeExtension::fileExcerpt() — Unescaped Non-PHP File Rendering

Low 2.0 Published Updated

Stored XSS in Symfony WebProfiler allows attackers to execute scripts in developer browsers via unescaped non-PHP file logs.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-45072?

CVE-2026-45072 is a low-severity cross-site scripting vulnerability in Sensiolabs Symfony, published on 14 Jul 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. From 6.4.24 until 6.4.40, 7.4.12, and 8.0.12, the development profiler file_excerpt Twig filter escapes PHP files through highlight_string() but interpolates lines from non-PHP files directly into <code> elements, allowing stored XSS against a developer who opens an attacker-written file such as var/log/dev.log in the profiler. This issue is fixed in versions 6.4.40, 7.4.12, and 8.0.12.

Weakness: CWE-79

Which versions are affected by CVE-2026-45072?

12 open source packages ship an affected version, including symfony/symfony, symfony/twig-bridge and symfony/web-profiler-bundle. It affects 1 product.

PackageAffectedFixed in
symfony/symfony PackagistFrom 6.4.246.4.40
symfony/symfony PackagistFrom 6.4.246.4.40
symfony/symfony PackagistFrom 7.2.97.4.12
symfony/symfony PackagistFrom 7.2.97.4.12
symfony/symfony PackagistFrom 8.0.08.0.12
symfony/symfony PackagistFrom 8.0.08.0.12
6 more packages
symfony/twig-bridge PackagistFrom 6.4.246.4.40
symfony/twig-bridge PackagistFrom 6.4.246.4.40
symfony/web-profiler-bundle PackagistFrom 7.2.97.4.12
symfony/web-profiler-bundle PackagistFrom 7.2.97.4.12
symfony/web-profiler-bundle PackagistFrom 8.0.08.0.12
symfony/web-profiler-bundle PackagistFrom 8.0.08.0.12

Products include Sensiolabs Symfony.

How do I fix CVE-2026-45072?

Upgrade symfony/symfony to a fixed version for your release line: 6.4.40, 7.4.12 or 8.0.12.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-45072 being exploited?

There is no known exploitation of CVE-2026-45072 in the wild and no public exploit code.

All Sensiolabs Symfony vulnerabilities

Sources

Also known as DEBIAN-CVE-2026-45072, GHSA-hmr5-2xcr-v8pp, UBUNTU-CVE-2026-45072.

Is CVE-2026-45072 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free