CVE-2026-45072

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

Published Jul 14, 2026 CVSS 4.0 · 2 Low EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

Symfony’s WebProfiler component contains a stored Cross‑Site Scripting flaw in the file_excerpt Twig filter. The filter escapes PHP files with highlight_string() but inserts raw lines from non‑PHP files, such as log files, directly into <code> elements. When a developer opens an attacker‑crafted file (for example, a malicious var/log/dev.log) in the profiler, the unescaped content is executed as JavaScript within that developer’s browser session. This vulnerability is recognized as CWE‑79 and exists in Symfony versions 6.4.24 through 6.4.39, 7.4.0 through 7.4.11, and 8.0.0 through 8.0.11; it was fixed in releases 6.4.40, 7.4.12, and 8.0.12.

Affected Systems

The issue affects the Symfony Core framework, the Twig Bridge component, and the WebProfiler bundle. Unpatched versions include 6.4.24 through 6.4.39, 7.4.0 through 7.4.11, and 8.0.0 through 8.0.11; the problem is resolved in releases 6.4.40, 7.4.12, and 8.0.12.

Risk and Exploitability

With a CVSS score of 2, the overall severity is low, and the EPSS score of less than 1 % indicates a very low likelihood of exploitation in practice. The vulnerability is not listed in the CISA KEV catalog. Attackers must first place a malicious file on the server and then have a developer who opens that file in the profiler to trigger the XSS; therefore the attack vector is limited to development and debugging environments, but the impact on the targeted developer can be significant.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Symfony, the Twig Bridge component, and the WebProfiler bundle to the fixed releases v6.4.40, v7.4.12, or v8.0.12 and later.
  • Restart the application to ensure the updated code is active.
  • If the application is already in production, disable or restrict access to the WebProfiler route so that non‑privileged users cannot trigger the rendering of non‑PHP file excerpts.
  • Remove any attacker‑controlled or unnecessary log files that the profiler could display.

Generated by OpenCVE AI on July 31, 2026 at 05:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DSA Debian DSA DSA-6312-1 symfony security update
Github GHSA Github GHSA GHSA-hmr5-2xcr-v8pp Symfony Vulnerable to stored XSS in WebProfiler CodeExtension::fileExcerpt() — Unescaped Non-PHP File Rendering
History
Type Values Removed Values Added
First Time appeared Symfony
Symfony symfony
Symfony twig-bridge
Symfony web-profiler-bundle
Vendors & Products Symfony
Symfony symfony
Symfony twig-bridge
Symfony web-profiler-bundle
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Symfony: Stored XSS in WebProfiler CodeExtension::fileExcerpt() — Unescaped Non-PHP File Rendering
Weaknesses CWE-79
References
Metrics cvssV4_0

{'score': 2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 15, 2026, 1:26 PM
Reserved
May 8, 2026, 6:45 PM
Status
Analyzed
Published
Jul 14, 2026, 7:17 PM
Modified
Jul 16, 2026, 3:12 AM