NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Composer (PHP)

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

lowCVSS 4.0 1.2GHSA-hmr5-2xcr-v8pp

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

Published May 27, 2026

Affected packages

symfony/symfony

Ecosystem
Composer (PHP)
Affected
>= 6.4.24, < 6.4.40
Fixed in
6.4.40
Check
composer show symfony/symfony

symfony/symfony

Ecosystem
Composer (PHP)
Affected
>= 7.2.9, < 7.4.12
Fixed in
7.4.12
Check
composer show symfony/symfony

symfony/symfony

Ecosystem
Composer (PHP)
Affected
>= 8.0.0, < 8.0.12
Fixed in
8.0.12
Check
composer show symfony/symfony

symfony/twig-bridge

Ecosystem
Composer (PHP)
Affected
>= 6.4.24, < 6.4.40
Fixed in
6.4.40
Check
composer show symfony/twig-bridge

symfony/web-profiler-bundle

Ecosystem
Composer (PHP)
Affected
>= 7.2.9, < 7.4.12
Fixed in
7.4.12
Check
composer show symfony/web-profiler-bundle

symfony/web-profiler-bundle

Ecosystem
Composer (PHP)
Affected
>= 8.0.0, < 8.0.12
Fixed in
8.0.12
Check
composer show symfony/web-profiler-bundle

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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 {$line} 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.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More Composer (PHP) vulnerabilities

All Composer (PHP) entries