{"id":"CVE-2026-49358","published":"2026-06-19T14:52:05Z","modified":"2026-06-23T02:09:16Z","title":"PhpWeasyPrint vulnerable to arbitrary file deletion at shutdown via public $temporaryFiles","vendor":"pontedilana","product":"php-weasyprint","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":3,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00166,"percentile":0.05906,"provenance":"source"},"cwes":[{"id":"CWE-73","name":"External Control of File Name or Path"}],"references":[{"url":"https://github.com/pontedilana/php-weasyprint/security/advisories/GHSA-5g9f-cwwg-4p8g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/KnpLabs/snappy/security/advisories/GHSA-87qc-37cw-84h4","tags":["x_refsource_MISC"]},{"url":"https://github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1bff0c099c9391","tags":["x_refsource_MISC"]},{"url":"https://github.com/pontedilana/php-weasyprint/releases/tag/2.6.0","tags":["x_refsource_MISC"]}],"priority":{"score":3.3,"factors":[{"name":"EPSS percentile","points":1.18},{"name":"CVSS severity","points":2.1}]},"vendorSlug":"pontedilana","affectedVersions":[{"vendor":"pontedilana","product":"php-weasyprint","versions":["< 2.6.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-06-23T02:08:49.575183Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"pontedilana/php-weasyprint","vulnerableRanges":["<2.6.0"],"patched":["2.6.0"],"from":["GHSA-5g9f-cwwg-4p8g"],"provenance":"source"}],"summary":{"text":"The flaw is in the php-weasyprint library (vendor pontedilana), in its AbstractGenerator component, where the public $temporaryFiles array is passed to unlink() during destruction and shutdown without checking that each path lies within the temporary folder. An attacker who can get code to hold a generator instance and insert an arbitrary path into that array can delete that file when the script shuts down, provided they already have local access with high privileges and the target uses a version before 2.6.0.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:23:29Z"},"euvd":{"id":"EUVD-2026-38036","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-knplabs-snappy-cve-2023-28115","parents":[{"from":"CVE-2026-49260","to":"CVE-2026-49358","relation":"successor","confidence":"high","kind":"lineage","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:pontedilana/php-weasyprint","fromFixed":"2.5.1","toFixed":"2.6.0","daysApart":0},{"kind":"same-code","provenance":"machine","files":["src/AbstractGenerator.php"],"commits":["https://github.com/pontedilana/php-weasyprint/commit/9e86a2b317237fc5728f712f5037164530117f7e","https://github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1bff0c099c9391"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.26,"basis":"same product + description similarity"}]},{"from":"CVE-2026-49286","to":"CVE-2026-49358","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/AbstractGenerator.php"],"commits":["https://github.com/pontedilana/php-weasyprint/commit/d1aa487722b5a3cab9b222b85fdb5608a5a550c3","https://github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1bff0c099c9391"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2026-49260","published":"2026-06-19","fixed":"2.5.1","kev":false},{"cve":"CVE-2026-49286","published":"2026-06-19","fixed":"2.6.0","kev":false},{"cve":"CVE-2026-49358","published":"2026-06-19","fixed":"2.6.0","kev":false},{"cve":"CVE-2026-49359","published":"2026-06-19","fixed":"2.6.0","kev":false}],"package":"Packagist:pontedilana/php-weasyprint"}}