LowGHSA-hmr5-2xcr-v8ppCVE-2026-45072

Symfony Vulnerable to stored XSS in WebProfiler CodeExtension::fileExcerpt() — Unescaped Non-PHP File Rendering

Published 27 May 2026 · Updated 10 Sept 2026

Affected packages

Affected
>=6.4.24 <6.4.40
Fixed in
6.4.40
Update to the fixed version for your release line, for example:composer require symfony/symfony:^6.4.40
Affected
>=7.2.9 <7.4.12
Fixed in
7.4.12
Update to the fixed version for your release line, for example:composer require symfony/symfony:^7.4.12
Affected
>=8.0.0 <8.0.12
Fixed in
8.0.12
Update to the fixed version for your release line, for example:composer require symfony/symfony:^8.0.12
Affected
>=6.4.24 <6.4.40
Fixed in
6.4.40
Update to the fixed version for your release line, for example:composer require symfony/twig-bridge:^6.4.40
Affected
>=7.2.9 <7.4.12
Fixed in
7.4.12
Update to the fixed version for your release line, for example:composer require symfony/web-profiler-bundle:^7.4.12
Affected
>=8.0.0 <8.0.12
Fixed in
8.0.12
Update to the fixed version for your release line, for example:composer require symfony/web-profiler-bundle:^8.0.12

Details

Description

Symfony's profiler, a development only debug UI, renders source-code excerpts on several pages using Twig's custom file_excerpt filter. This filter renders PHP files via highlight_string() (which escapes HTML), but renders non-PHP files by splitting on \n and interpolating each line directly into <code>{$line}</code> with no escaping.

An attacker who can write arbitrary bytes into any file under the project root (including e.g. var/log/dev.log), achieves stored XSS against any developer who later opens that file in the profiler.

Resolution

The file_excerpt filter now properly escapes each line of non-PHP files using htmlspecialchars() before concatenating them.

The patch for this issue is available here for branch 6.4.

Credits

Symfony would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.

Is GHSA-hmr5-2xcr-v8pp in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected symfony/symfony, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.