Skip to main content

PhpWeasyPrint EUVDEUVD-2026-38036

| CVE-2026-49358 LOW
External Control of File Name or Path (CWE-73)
2026-06-19 GitHub_M GHSA-5g9f-cwwg-4p8g
3.0
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Attacker deploys malicious Composer package
  2. Delivery
    Package obtains reference to generator instance
  3. Exploit
    Inject target file path into public $temporaryFiles
  4. Execution
    PHP process shutdown triggers removeTemporaryFiles()
  5. Impact
    unlink() deletes arbitrary file

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V5 - File Handling File name/path control
Exploitation Conditions

Exploitation requires that the attacker's code runs within the same PHP process as the PhpWeasyPrint generator instance and can obtain a reference to that instance object. This is a local, code-level attack: the attacker must be a PHP module, Composer package, or other in-process code co-located with the application. The $temporaryFiles property must be public (which it is, by default, in all versions prior to 2.6.0). The deletion occurs at script shutdown or object destruction - meaning the attacker does not need to trigger any special application action beyond ensuring the generator object is instantiated. Limiting factors include: (1) the attacker must have code execution within the PHP application process, not merely network access; (2) the attacker must be able to reference the specific generator instance; (3) files outside the OS filesystem (e.g., remote paths) are not reachable via unlink(). This is not exploitable by unauthenticated remote attackers against default configurations of PhpWeasyPrint.

Impact

The NVD-assigned CVSS 3.1 score of 3.0 (AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L) accurately reflects the constrained threat model: exploitation requires local code-level access to the PHP process and high privilege (the ability to reference or inject into the generator object), making this a low-priority issue in isolation. There is no KEV listing, no public proof-of-concept, and no EPSS data was provided. The tags in the input reference 'RCE,' which is a mislabeling - this vulnerability enables arbitrary file deletion, not remote code execution; security teams should not treat it as an RCE vector. The real-world risk materializes primarily in shared-hosting or multi-tenant PHP environments, or when untrusted third-party composer packages co-exist in the same process - scenarios where the high-privilege requirement is effectively met by the attacker's package code running in the application's context. Outside of those scenarios, the practical risk is low.

Exploit ScenarioDerived

A malicious or compromised Composer package installed alongside PhpWeasyPrint obtains a reference to a generator instance during the application's normal PDF rendering flow, then appends a sensitive file path (such as a configuration file or database credential file) to $temporaryFiles. When the PHP script completes - either via normal termination or via the registered shutdown function - removeTemporaryFiles() iterates the array and calls unlink() on the injected path, silently deleting it without any path-safety check. No public proof-of-concept has been identified, but the attack pattern is straightforward given the public property.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.1% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jun 19, 2026

Arbitrary file deletion in PhpWeasyPrint prior to version 2.6.0 allows any code holding a reference to a generator instance to inject arbitrary filesystem paths into the public AbstractGenerator::$temporaryFiles array, which are then passed to unlink() without path-containment validation during script shutdown or object destruction. The vulnerability mirrors a previously disclosed pattern in the related KnpLabs/snappy library (GHSA-87qc-37cw-84h4), and is exploitable by malicious dependencies, plugin code, or any PHP code co-located in the same process with access to the generator object. No public exploit has been identified at time of analysis, and exploitation is substantially constrained by the requirement for high privileges and local code access.

RemediationAI

The primary fix is to upgrade pontedilana/php-weasyprint to version 2.6.0, which introduces path-containment validation in removeTemporaryFiles() via realpath() and strncmp() prefix enforcement. The patch commit is available at https://github.com/pontedilana/php-weasyprint/commit/6d328ffd3bcb800c7c2e8a594b1bff0c099c9391 and the release at https://github.com/pontedilana/php-weasyprint/releases/tag/2.6.0. If immediate upgrade is not feasible, a compensating control is to audit all Composer dependencies for code that accesses generator instances directly and restrict the visibility surface by wrapping generator usage in a factory pattern that prevents external reference acquisition. Note that changing $temporaryFiles visibility in application code without patching the library does not prevent exploitation by third-party packages that access the property via reflection. There are no known configuration-level workarounds that eliminate the risk without upgrading.

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 (cpe:2.3:a:pontedilana:php-weasyprint:*:*:*:*:*:*:*:*) is a PHP wrapper around the WeasyPrint binary used to render PDFs from HTML or URLs. The root cause is CWE-73 (External Control of File Name or Path): the $temporaryFiles property is declared public, and the cleanup routine removeTemporaryFiles() - invoked both from __destruct() and a registered PHP shutdown function - iterates the array and calls unlink() on each entry without first resolving the real path and confirming it resides within the designated temporary directory. PHP's realpath() is the standard mitigation, and the patch in commit 6d328ffd confirms this: it resolves the temporary folder via realpath(), strips trailing separators, and uses strncmp() to enforce a prefix check before any unlink() call is made. The shutdown-function registration means the attack window extends to the full PHP process lifetime, not just object scope.

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 3.0 LOW
AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:L
vuln.today AI 3.0 LOW

Local code access and high privilege (PR:H) required to reference the generator instance; no confidentiality impact; limited integrity and availability from file deletion only.

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

1
Patch available
Jun 19, 2026 - 16:01 EUVD

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.1%
Top 98% exploitable
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

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 LOW
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.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· derived
Defer
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

35
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +15
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

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