Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. symfony/twig-bridge
  4. ›
  5. CVE-2026-45072

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

May 27, 2026

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.

References

  • github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45072.yaml
  • github.com/FriendsOfPHP/security-advisories/blob/master/symfony/twig-bridge/CVE-2026-45072.yaml
  • github.com/FriendsOfPHP/security-advisories/blob/master/symfony/web-profiler-bundle/CVE-2026-45072.yaml
  • github.com/advisories/GHSA-hmr5-2xcr-v8pp
  • github.com/symfony/symfony/commit/863aa81c61166f1aa74b7732df316f76113acbdb
  • github.com/symfony/symfony/security/advisories/GHSA-hmr5-2xcr-v8pp
  • nvd.nist.gov/vuln/detail/CVE-2026-45072
  • symfony.com/cve-2026-45072

Code Behaviors & Features

Detect and mitigate CVE-2026-45072 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 6.4.24 before 6.4.40

Fixed versions

  • 6.4.40

Solution

Upgrade to version 6.4.40 or above.

Impact 4.6 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

packagist/symfony/twig-bridge/CVE-2026-45072.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:24:34 +0000.