Skip to main content

PhpWeasyPrint EUVDEUVD-2026-38053

| CVE-2026-49286 HIGH
Deserialization of Untrusted Data (CWE-502)
2026-06-19 GitHub_M GHSA-2fmj-p74r-3wjm
8.1
CVSS 3.1 · Vendor: GitHub_M
Share

Severity by source

Vendor (GitHub_M) PRIMARY
8.1 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI
8.1 HIGH

Network-reachable when the filename parameter is exposed to input (AV:N, PR:N); AC:H because exploitation requires PHP 7, a stageable PHAR with a gadget chain, and attacker-influenced output path; full RCE yields C/I/A:H.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
Patch available
Jun 19, 2026 - 19:02 EUVD
Source Code Evidence Fetched
Jun 19, 2026 - 18:16 vuln.today
Analysis Generated
Jun 19, 2026 - 18:16 vuln.today

DescriptionCVE.org

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.

AnalysisAI

PHAR deserialization in PhpWeasyPrint versions prior to 2.6.0 allows remote code execution by bypassing the case-sensitive phar:// blacklist introduced for CVE-2023-28115 - because PHP stream wrappers are case-insensitive, schemes like PHAR:// or PhAr:// pass the check and reach file_exists() in prepareOutput(). When the library runs on PHP 7.4+ and an attacker can influence the output filename argument passed to generation methods, a crafted PHAR archive's metadata is unserialized via a gadget chain, yielding code execution. No CISA KEV listing and no public exploit identified at time of analysis for this specific CVE, although the equivalent upstream KnpLabs/snappy advisory (GHSA-92rv-4j2h-8mjj) ships a working phpggc-based PoC that is directly portable.

Technical ContextAI

PhpWeasyPrint (pontedilana/php-weasyprint) is a PHP wrapper around the WeasyPrint binary used to generate PDFs from URLs or HTML. The root cause is CWE-502 Deserialization of Untrusted Data, triggered through PHP's phar:// stream wrapper: when file_exists() (or similar filesystem functions) is invoked on a phar:// URL, the PHP engine parses the archive and unserializes its metadata block, instantiating arbitrary classes and invoking magic methods such as __destruct/__wakeup. The originally shipped fix for CVE-2023-28115 (mirrored in snappy 1.4.2) used strpos($filename, 'phar://') === 0, but PHP wrapper resolution is case-insensitive, so PHAR://, Phar://, pHaR:// all reach the vulnerable fileExists() call inside AbstractGenerator::prepareOutput(). The 2.6.0 patch (commit d1aa487) replaces the blacklist with a parse_url-based allow-list that only accepts the 'file' scheme (plus a Windows drive-letter regex), making the protocol check robust against case and against other wrappers like php://filter, http://, ftp://. PHAR metadata deserialization in this form requires PHP < 8.0; PHP 8 removed automatic PHAR metadata unserialization on filesystem function calls, so vulnerable deployments are PHP 7.4 installations that the library still officially supports.

RemediationAI

Vendor-released patch: PhpWeasyPrint 2.6.0, available at https://github.com/pontedilana/php-weasyprint/releases/tag/2.6.0, which replaces the case-sensitive phar:// blacklist with a parse_url-based allow-list of the 'file' scheme (commit d1aa487722b5a3cab9b222b85fdb5608a5a550c3). If immediate upgrade is not possible, the highest-impact compensating control is to upgrade the PHP runtime to 8.0+ where PHAR metadata is no longer auto-deserialized by filesystem functions, which neutralizes the exploitation path entirely at the cost of a PHP version migration. As an application-level workaround, never pass user-controlled data into the second argument of Pdf::generate(), generateFromHtml(), or Image equivalents - wrap callers so the output filename is constructed server-side from a fixed directory plus a sanitized identifier; this fully blocks the vector but requires touching every call site. A weaker stop-gap is to add an application-side allow-list check that rejects any output path matching /^[a-z]+:/i except literal 'file:' before invoking the generator. See also the upstream KnpLabs/snappy advisory at https://github.com/KnpLabs/snappy/security/advisories/GHSA-92rv-4j2h-8mjj.

More in PHP

View all
CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

CVE-2024-46506 CRITICAL POC
10.0 May 13

NetAlertX (formerly PiAlert) versions 23.01.14 through 24.x before 24.10.12 allow unauthenticated command injection thro

Share

EUVD-2026-38053 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy