CVE-2026-49358PhpWeasyPrint vulnerable to arbitrary file deletion at shutdown via public $temporaryFiles
- 3.0LowCVSS base score
- 0.17%Exploitation in 30 daysEPSS · top 94% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- YesPublic exploitsa reference or SSVC says so
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.
Public exploit
An exploit or proof of concept is public: anyone can try it against an unpatched system. A reference of the record is tagged as an exploit. CISA's SSVC rates its exploitation: a proof of concept is public.
Show the exploits1
References tagged exploit1 reference
Timeline
ID reserved
By GitHub_M
- 21 days later
· 21 days later
Published
- 4 days later
· 4 days later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | Low3.0 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L |
| NVDNVD · Deferred | 3.1 | Low3.0 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L |
- EPSS (exploitation in 30 days)
- 0.17% · top 94% of all CVEs (15 Nov 2026)
- CISA SSVC
- Exploitation: poc · Automatable: no · Technical impact: partial
The list uses the assigner's score when there is one, then CISA's, then NVD's: Low 3.0.
Affected products
- affected < 2.6.0
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- Packagistpontedilana/php-weasyprintGHSA-5g9f-cwwg-4p8g (opens in a new tab)
References
References4
- https://github.com/pontedilana/php-weasyprint/security/advisories/GHSA-5g9f-cwwg-4p8g (opens in a new tab)x_refsource_CONFIRMexploit
- https://github.com/KnpLabs/snappy/security/advisories/GHSA-87qc-37cw-84h4 (opens in a new tab)x_refsource_MISC
- https://github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1bff0c099c9391 (opens in a new tab)x_refsource_MISC
- https://github.com/pontedilana/php-weasyprint/releases/tag/2.6.0 (opens in a new tab)x_refsource_MISC
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2026-38036 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-5g9f-cwwg-4p8g (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2026-49358)Record last updated .