Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker deploys malicious Composer package
-
DeliveryPackage obtains reference to generator instance
-
ExploitInject target file path into public $temporaryFiles
-
ExecutionPHP process shutdown triggers removeTemporaryFiles()
-
Impactunlink() deletes arbitrary file
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V5 - File Handling File name/path control
|
| Exploitation Conditions | Exploitation requires that the attacker's code runs within the same PHP process as the PhpWeasyPrint generator instance and can obtain a reference to that instance object. This is a local, code-level attack: the attacker must be a PHP module, Composer package, or other in-process code co-located with the application. The |
| Impact | The NVD-assigned CVSS 3.1 score of 3.0 (AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L) accurately reflects the constrained threat model: exploitation requires local code-level access to the PHP process and high privilege (the ability to reference or inject into the generator object), making this a low-priority issue in isolation. There is no KEV listing, no public proof-of-concept, and no EPSS data was provided. The tags in the input reference 'RCE,' which is a mislabeling - this vulnerability enables arbitrary file deletion, not remote code execution; security teams should not treat it as an RCE vector. The real-world risk materializes primarily in shared-hosting or multi-tenant PHP environments, or when untrusted third-party composer packages co-exist in the same process - scenarios where the high-privilege requirement is effectively met by the attacker's package code running in the application's context. Outside of those scenarios, the practical risk is low. |
| Exploit ScenarioDerived | A malicious or compromised Composer package installed alongside PhpWeasyPrint obtains a reference to a generator instance during the application's normal PDF rendering flow, then appends a sensitive file path (such as a configuration file or database credential file) to |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 19, 2026
Arbitrary file deletion in PhpWeasyPrint prior to version 2.6.0 allows any code holding a reference to a generator instance to inject arbitrary filesystem paths into the public AbstractGenerator::$temporaryFiles array, which are then passed to unlink() without path-containment validation during script shutdown or object destruction. The vulnerability mirrors a previously disclosed pattern in the related KnpLabs/snappy library (GHSA-87qc-37cw-84h4), and is exploitable by malicious dependencies, plugin code, or any PHP code co-located in the same process with access to the generator object. No public exploit has been identified at time of analysis, and exploitation is substantially constrained by the requirement for high privileges and local code access.
RemediationAI
The primary fix is to upgrade pontedilana/php-weasyprint to version 2.6.0, which introduces path-containment validation in removeTemporaryFiles() via realpath() and strncmp() prefix enforcement. The patch commit is available at https://github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1bff0c099c9391 and the release at https://github.com/pontedilana/php-weasyprint/releases/tag/2.6.0. If immediate upgrade is not feasible, a compensating control is to audit all Composer dependencies for code that accesses generator instances directly and restrict the visibility surface by wrapping generator usage in a factory pattern that prevents external reference acquisition. Note that changing $temporaryFiles visibility in application code without patching the library does not prevent exploitation by third-party packages that access the property via reflection. There are no known configuration-level workarounds that eliminate the risk without upgrading.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in composer, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
PhpWeasyPrint (cpe:2.3:a:pontedilana:php-weasyprint:*:*:*:*:*:*:*:*) is a PHP wrapper around the WeasyPrint binary used to render PDFs from HTML or URLs. The root cause is CWE-73 (External Control of File Name or Path): the $temporaryFiles property is declared public, and the cleanup routine removeTemporaryFiles() - invoked both from __destruct() and a registered PHP shutdown function - iterates the array and calls unlink() on each entry without first resolving the real path and confirming it resides within the designated temporary directory. PHP's realpath() is the standard mitigation, and the patch in commit 6d328ffd confirms this: it resolves the temporary folder via realpath(), strips trailing separators, and uses strncmp() to enforce a prefix check before any unlink() call is made. The shutdown-function registration means the attack window extends to the full PHP process lifetime, not just object scope.
Know when PHP gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L
Local code access and high privilege (PR:H) required to reference the generator instance; no confidentiality impact; limited integrity and availability from file deletion only.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
PhpWeasyPrint is a PHP library allowing PDF generation from a URL or an HTML page. Prior to version 2.6.0, AbstractGenerator::$temporaryFiles is a public array, and removeTemporaryFiles() - invoked from __destruct() and from a registered shutdown function - calls unlink() on every entry without verifying that the path is contained within the temporary folder. Any code holding a reference to a generator instance can push an arbitrary path into the array and have it deleted on script shutdown. This mirrors the KnpLabs/snappy issue GHSA-87qc-37cw-84h4. PhpWeasyPrint version 2.6.0 contains a patch for the issue.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
EUVD-2026-38036
GHSA-5g9f-cwwg-4p8g
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB