PhpWeasyPrint vulnerable to arbitrary file deletion at shutdown via public $temporaryFiles
Summary
| CVE | CVE-2026-49358 |
|---|---|
| State | PUBLISHED |
| Assigner | GitHub_M |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-06-19 15:16:35 UTC |
| Updated | 2026-06-19 15:16:35 UTC |
| Description | 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. |
Risk And Classification
Primary CVSS: v3.1 3 LOW from [email protected]
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L
Problem Types: CWE-73 | CWE-73 CWE-73: External Control of File Name or Path
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | [email protected] | Secondary | 3 | LOW | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L |
| 3.1 | CNA | DECLARED | 3 | LOW | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L |
CVSS v3.1 Breakdown
Attack Vector
LocalAttack Complexity
HighPrivileges Required
HighUser Interaction
NoneScope
UnchangedConfidentiality
NoneIntegrity
LowAvailability
LowCVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Pontedilana | Php-weasyprint | affected < 2.6.0 | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| github.com/pontedilana/php-weasyprint/releases/tag/2.6.0 | [email protected] | github.com | |
| github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1... | [email protected] | github.com | |
| github.com/KnpLabs/snappy/security/advisories/GHSA-87qc-37cw-84h4 | [email protected] | github.com | |
| github.com/pontedilana/php-weasyprint/security/advisories/GHSA-5g9f-cwwg... | [email protected] | github.com | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
No vendor comments have been submitted for this CVE.
There are currently no legacy QID mappings associated with this CVE.