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
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L
Lifecycle Timeline
3DescriptionCVE.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.
AnalysisAI
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.
Technical ContextAI
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.
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.
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
NetAlertX (formerly PiAlert) versions 23.01.14 through 24.x before 24.10.12 allow unauthenticated command injection thro
Same weakness CWE-73 – External Control of File Name or Path
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-38036
GHSA-5g9f-cwwg-4p8g