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
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify endpoint passing user input to PhpWeasyPrint output filename
  2. Delivery
    Stage crafted PHAR with phpggc gadget chain on reachable filesystem path
  3. Exploit
    Submit request with output filename PHAR://path/exploit.phar
  4. Execution
    Bypass case-sensitive blacklist, reach file_exists()
  5. Persist
    PHP unserializes PHAR metadata and triggers gadget __destruct
  6. Impact
    Execute arbitrary code as web server user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires (1) the application to forward attacker-controlled data into the $filename / output-path parameter of PhpWeasyPrint's generate(), generateFromHtml(), or generateFromHtmlFile() (and Image equivalents) before they call prepareOutput(); (2) the host PHP runtime to be PHP 7.4 through 7.x - PHP 8.0+ removed implicit PHAR metadata unserialization on filesystem calls and is not exploitable; (3) a PHAR archive containing a viable PHP unserialize gadget chain (e.g. via phpggc against an autoloaded library such as Monolog) to be writable to or otherwise reachable from a filesystem path the PHP process can stat. Limiting factors that meaningfully cut realistic risk: applications that hardcode the output path or build it from server-side state are not exploitable; deployments already on PHP 8+ are not exploitable; absence of any PHAR-upload or writable-path primitive on the server eliminates the gadget delivery step. Authentication requirements are not confirmed from available data - CVSS lists PR:N but this presumes the vulnerable parameter is reachable from unauthenticated input, which is application-specific.

Impact

The CVSS 3.1 score of 8.1 (AV:N/AC:H/PR:N/UI:N/C:H/I:H/A:H) reflects a serious RCE primitive but appropriately marks AC:H because exploitation depends on the application passing attacker-influenced data into the output-filename parameter of generate()/generateFromHtml(), on the host running PHP 7.x, and on a PHAR file with a viable gadget chain being reachable from the target filesystem. The vulnerability is not in CISA KEV and no EPSS score was provided, so prioritization should lean on the deployment-specific question 'does any code path let untrusted input reach the second argument of these generators?'. Where that exposure exists on PHP 7.4 hosts, real-world risk is high because the upstream snappy advisory already publishes a turnkey phpggc Monolog/RCE1 PoC and the bypass requires only a single character-case change; where applications run on PHP 8 or hardcode the output path, real-world risk collapses to near-zero despite the high CVSS. Note that PR:N in the vector is an assumption that the filename parameter is reachable from network input - this is application-specific and worth validating per deployment.

Exploit ScenarioDerived

An application uses PhpWeasyPrint on PHP 7.4 to render user-supplied HTML to a PDF whose output filename is derived from a request parameter (for example a 'report_name' field). The attacker first uploads or stages a PHAR archive whose metadata contains a phpggc-generated gadget chain (e.g. Monolog/RCE1 with -f for fast destruct) into any path reachable by the PHP process - uploads dir, /tmp via a separate flow, or a remote PHAR over a wrapper - then submits a request that sets the output filename to PHAR:///var/www/uploads/exploit.phar; the case-insensitive scheme bypasses the blacklist, file_exists() unserializes the metadata, and the gadget chain executes arbitrary commands as the web user. A publicly available PoC for the upstream snappy equivalent ships in GHSA-92rv-4j2h-8mjj and is directly portable.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 19, 2026

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.

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.

Affected VersionsENISA

php-weasyprint < 2.6.0

Affected Packages

composer pontedilana/php-weasyprint fix: 2.6.0
euvd php_weasyprint fix: 2.6.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

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

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

1
Patch available
Jun 19, 2026 - 19:02 EUVD

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.

Executive ViewAI

Why It Matters

PhpWeasyPrint versions prior to 2.6.0 are vulnerable to remote code execution through PHAR deserialization when application code allows attackers to influence output filename parameters. This affects organizations running PHP 7.4 or later with PhpWeasyPrint in user-facing functionality, creating risk of data breach, service disruption, and infrastructure compromise through uncontrolled code execution.

Business Impact: High
Compensating Controls

Apply vendor patch: Upgrade to PhpWeasyPrint 2.6.0 or later.

Threat Intelligence Overview

EPSS Score
0.6%
Top 58% exploitable
Threat Intel
1
1 sources
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

41
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

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

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