Read the docs
TI-2026-36531 Aliases CVE-2026-49358GHSA-5g9f-cwwg-4p8g

PhpWeasyPrint vulnerable to arbitrary file deletion at shutdown via public $temporaryFiles

Priority MEDIUM 48CWE-73Published · Updated

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

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00166 5th percentileScored 2026-11-07
Fix Fixed php-weasyprint (pontedilana): 2.6.0pontedilana/php-weasyprint (Packagist): 2.6.0

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

VendorProductAffected versionsFixed inStatusSource
pontedilanaphp-weasyprintbefore 2.6.02.6.0Patch availableCNA
—pontedilana/php-weasyprint (Packagist)before 2.6.02.6.0Patch availableGHSA-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

  1. 2026-10-02 Threatist record created from CVE-2026-49358
  2. 2026-10-03 Alias added: GHSA-5g9f-cwwg-4p8g

References

  • 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