PhpWeasyPrint vulnerable to arbitrary file deletion at shutdown via public $temporaryFiles
Key facts
- Attack vector
- Local
- Privileges required
- High
- User interaction
- None
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- None · Low · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pontedilana | php-weasyprint | before 2.6.0 | 2.6.0 | Patch available | CNA |
| — | pontedilana/php-weasyprint (Packagist) | before 2.6.0 | 2.6.0 | Patch available | GHSA-5g9f-cwwg-4p8g |
- php-weasyprint Vendorpontedilana Affected before 2.6.0 Fixed in 2.6.0 Patch available CNA
- pontedilana/php-weasyprint (Packagist) Vendor— Affected before 2.6.0 Fixed in 2.6.0 Patch available GHSA-5g9f-cwwg-4p8g
Remediation
- Fix · CNA php-weasyprint (pontedilana) Fixed in 2.6.0
- Fix · GHSA-5g9f-cwwg-4p8g pontedilana/php-weasyprint (Packagist) Fixed in 2.6.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-49358
- 2026-10-03 Alias added: GHSA-5g9f-cwwg-4p8g
References
Other 5
- https://github.com/pontedilana/php-weasyprint/security/advisories/GHSA-5g9f-cwwg-4p8g
- https://github.com/KnpLabs/snappy/security/advisories/GHSA-87qc-37cw-84h4
- https://github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1bff0c099c9391
- https://github.com/pontedilana/php-weasyprint/releases/tag/2.6.0
- https://github.com/pontedilana/php-weasyprint
More pontedilana vulnerabilities
- TI-2026-36455 OS command injection in pontedilana php-weasyprint CVSS 3.1HIGH 8.2
- TI-2026-36472 PhpWeasyPrint vulnerable to PHAR deserialization via output filename (CVE-2023-28115 case-insensitive bypass) CVSS 3.1HIGH 8.1
- TI-2026-36532 PhpWeasyPrint vulnerable to SSRF and local file disclosure via the attachment option CVSS 3.1MEDIUM 6.5
Sources
- CVE-2026-49358 · CVE Program
- CVE-2026-49358 · NVD
- FIRST EPSS
- GHSA-5g9f-cwwg-4p8g · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences