CVE-2026-45072·PHP vulnerability
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.
- Severity
- medium
- Software
- PHP
- Fixed in
- 8.0.12
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.23% — higher than 14% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
From: 8.0.0
Until: 8.0.12
Fixed in: 8.0.12
How to fix this CVE
Update Symfony to version 8.0.12 or later to patch a stored XSS vulnerability in the development profiler's file_excerpt Twig filter. The vulnerability allows attackers to inject malicious code into non-PHP files that gets rendered without proper escaping when viewed in the profiler. Developers should immediately upgrade to eliminate the risk of XSS attacks targeting development environments.
sudo dnf update phpDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST|GET /_profiler/.*file_excerpt.*\.log|var/log/dev\.log.*<script|javascript:|<iframe|onerror=|onload=WAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Block or restrict access to the /_profiler endpoint in production environments using a WAF rule that denies requests to paths matching /_profiler.* unless originating from trusted internal IP addresses. Additionally, implement response filtering to encode or strip HTML/JavaScript from profiler output.How to check if you are affected
- Check your Symfony version by running: php bin/console about | grep Symfony or grep -i version composer.lock
- Verify if the development profiler is exposed by checking if var/log/dev.log exists and is accessible via the web interface at /_profiler
- Search application logs for suspicious script tags or HTML entities in log file entries: grep -E '<script|<iframe|javascript:' var/log/dev.log
- Confirm the patch by running: php bin/console about and verifying Symfony version is 8.0.12 or later
Indicators of compromise
- /_profiler endpoint access with malicious payload in log files
- Encoded script tags in var/log/dev.log
- HTTP requests containing script injection attempts to file paths viewable in the profiler
FAQ
What is CVE-2026-45072?
This is a stored XSS vulnerability in Symfony's development profiler where the file_excerpt Twig filter fails to properly escape content from non-PHP files, allowing attackers to inject malicious scripts into log files that execute when a developer views them in the profiler interface.
Is CVE-2026-45072 being actively exploited?
No, this vulnerability is not currently listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are available, though the risk remains for development environments with accessible profilers.
What versions of PHP are affected by CVE-2026-45072?
This vulnerability affects Symfony 8.0.0 through 8.0.11 running on PHP. The corresponding affected ranges for other Symfony versions are 6.4.24-6.4.39 and 7.4.0-7.4.11.
How do I check if my server is vulnerable to CVE-2026-45072?
Run 'php bin/console about' to check your Symfony version. If it shows 8.0.0 through 8.0.11, your installation is vulnerable and requires immediate upgrade to 8.0.12 or later.
Does Defensia detect CVE-2026-45072?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PHP and Symfony are installed on a monitored server, CVE-2026-45072 will appear in your dashboard with remediation steps.
Related PHP CVEs
References
- https://github.com/symfony/symfony/commit/863aa81c61166f1aa74b7732df316f76113acbdb
- https://github.com/symfony/symfony/releases/tag/v6.4.40
- https://github.com/symfony/symfony/releases/tag/v7.4.12
- https://github.com/symfony/symfony/releases/tag/v8.0.12
- https://github.com/symfony/symfony/security/advisories/GHSA-hmr5-2xcr-v8pp
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-45072. Free for 1 server.
Get started free