CVE-2026-49286: CWE-502: Deserialization of Untrusted Data in pontedilana php-weasyprint
PhpWeasyPrint is a PHP library allowing PDF generation from a URL or an HTML page. Prior to version 2.6.0, `pontedilana/php-weasyprint` guarded the output filename against the `phar://` stream wrapper with a case-sensitive blacklist. PHP stream wrappers are case-insensitive, so `PHAR://`, `Phar://`, etc. bypass the check and reach `fileExists()` (`file_exists()`) in `prepareOutput()`. On PHP 7 (which the library still supports — PHP 7.4+), this triggers deserialization of a crafted PHAR archive's metadata, leading to remote code execution. This is the patch-bypass of CVE-2023-28115. The same issue and fix were handled upstream in KnpLabs/snappy (GHSA-92rv-4j2h-8mjj). PhpWeasyPrint version 2.6.0 contains a patch for the issue.
AI Analysis
Technical Summary
PhpWeasyPrint is a PHP library for generating PDFs from URLs or HTML pages. Before version 2.6.0, it used a case-sensitive blacklist to block the phar:// stream wrapper in output filenames, but PHP stream wrappers are case-insensitive. Variants like PHAR:// bypass the blacklist and reach the file_exists() check in prepareOutput(), triggering deserialization of malicious PHAR metadata on PHP 7.4 and later. This vulnerability is a patch bypass of CVE-2023-28115 and is similar to an issue fixed upstream in KnpLabs/snappy. The vulnerability is identified as CWE-502 (Deserialization of Untrusted Data) and has a CVSS 3.1 score of 8.1 (high severity).
Potential Impact
Successful exploitation allows remote code execution due to deserialization of untrusted data from crafted PHAR archives. This impacts confidentiality, integrity, and availability of affected systems running vulnerable versions of php-weasyprint on PHP 7.4 or later.
Mitigation Recommendations
Upgrade php-weasyprint to version 2.6.0 or later, which contains a patch for this vulnerability. Patch status is not explicitly confirmed beyond the version bump, so verify with the vendor advisory or official repository for the latest remediation guidance.
CVE-2026-49286: CWE-502: Deserialization of Untrusted Data in pontedilana php-weasyprint
Description
PhpWeasyPrint is a PHP library allowing PDF generation from a URL or an HTML page. Prior to version 2.6.0, `pontedilana/php-weasyprint` guarded the output filename against the `phar://` stream wrapper with a case-sensitive blacklist. PHP stream wrappers are case-insensitive, so `PHAR://`, `Phar://`, etc. bypass the check and reach `fileExists()` (`file_exists()`) in `prepareOutput()`. On PHP 7 (which the library still supports — PHP 7.4+), this triggers deserialization of a crafted PHAR archive's metadata, leading to remote code execution. This is the patch-bypass of CVE-2023-28115. The same issue and fix were handled upstream in KnpLabs/snappy (GHSA-92rv-4j2h-8mjj). PhpWeasyPrint version 2.6.0 contains a patch for the issue.
CVSS v3.1
Score 8.1high
Affected software
pkg:composer/pontedilana/php-weasyprintRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
PhpWeasyPrint is a PHP library for generating PDFs from URLs or HTML pages. Before version 2.6.0, it used a case-sensitive blacklist to block the phar:// stream wrapper in output filenames, but PHP stream wrappers are case-insensitive. Variants like PHAR:// bypass the blacklist and reach the file_exists() check in prepareOutput(), triggering deserialization of malicious PHAR metadata on PHP 7.4 and later. This vulnerability is a patch bypass of CVE-2023-28115 and is similar to an issue fixed upstream in KnpLabs/snappy. The vulnerability is identified as CWE-502 (Deserialization of Untrusted Data) and has a CVSS 3.1 score of 8.1 (high severity).
Potential Impact
Successful exploitation allows remote code execution due to deserialization of untrusted data from crafted PHAR archives. This impacts confidentiality, integrity, and availability of affected systems running vulnerable versions of php-weasyprint on PHP 7.4 or later.
Mitigation Recommendations
Upgrade php-weasyprint to version 2.6.0 or later, which contains a patch for this vulnerability. Patch status is not explicitly confirmed beyond the version bump, so verify with the vendor advisory or official repository for the latest remediation guidance.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-28T20:07:58.862Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a358c5cf198dc38c1f2fbc6
Added to database: 06/19/2026, 18:37:16 UTC
Last enriched: 06/19/2026, 18:50:50 UTC
Last updated: 06/20/2026, 23:27:27 UTC
Views: 11
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.