Skip to main content

PhpWeasyPrint CVE-2026-49359

| EUVDEUVD-2026-38054 MEDIUM
Server-Side Request Forgery (SSRF) (CWE-918)
2026-06-19 GitHub_M GHSA-x8g9-h984-pc36
6.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Authenticate to application with low-privilege access
  2. Delivery
    Submit crafted scheme URL (file:// or php://filter) as attachment option value
  3. Exploit
    isOptionUrl() validates scheme via FILTER_VALIDATE_URL without allowlist
  4. Execution
    PHP calls file_get_contents() fetching local file or internal endpoint
  5. Persist
    Sensitive bytes embedded as PDF attachment
  6. Impact
    Download generated PDF to exfiltrate data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Credential Access

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

Exploitation Conditions

Exploitation requires that application code passes user-controlled input directly to the attachment option of the Pdf class without sanitization (e.g., $pdf->setOption('attachment', $_GET['file'])). The CVSS PR:L metric confirms that some level of application access or authentication is needed to reach the vulnerable code path - unauthenticated exploitation against a default installation is not supported by the available data. The file:// and php://filter primitives additionally require the PHP daemon to have read permissions on the targeted file path; running PHP as root, as specifically noted in the analogous KnpLabs/snappy advisory, maximizes the files accessible via this path. The SSRF primitive (internal HTTP endpoints, cloud metadata) does not require elevated PHP process permissions. No special WeasyPrint binary configuration is needed - the vulnerability is entirely within the PHP library's URL-fetching logic in src/Pdf.php.

Impact

The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N, score 6.5) accurately characterizes the core risk: network-exploitable, low complexity, but gated on low-privilege application access (PR:L) to supply a crafted attachment value. The high confidentiality impact (C:H) is well-founded - successful exploitation yields arbitrary local file read or SSRF against internal services. Scope:Unchanged is appropriate since impact stays within the application process boundary. No EPSS score was included in the provided data. No CISA KEV listing exists and no public exploit code has been identified at time of analysis, making this a 'no public exploit identified at time of analysis' case. Real-world exploitability is entirely contingent on whether application code exposes the attachment option to user-controlled input - a pattern the advisory explicitly warns against. In cloud-hosted environments, the SSRF primitive can reach instance metadata endpoints (e.g., http://169.254.169.254/), significantly elevating impact. The file:// and php:// primitives have greatest impact when PHP runs as root, as noted in the analogous KnpLabs/snappy advisory. The overall signal is: medium-severity per CVSS, but with high real-world impact potential in common cloud deployment patterns where user input is insufficiently sanitized before reaching the library.

Exploit ScenarioDerived

An attacker with authenticated low-privilege access submits a PDF generation request where the attachment parameter contains php://filter/convert.base64-encode/resource=/etc/passwd; the pre-2.6.0 library validates this as a URL via FILTER_VALIDATE_URL and calls file_get_contents() on it, reading and base64-encoding the target file's contents. The resulting bytes are embedded into the generated PDF as an attachment, which the attacker downloads and decodes to recover the plaintext of /etc/passwd or any other file readable by the PHP process. No POC code has been publicly released, but the attack pattern is fully described in the vendor security advisory GHSA-x8g9-h984-pc36.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jun 19, 2026

PhpWeasyPrint (pontedilana/php-weasyprint) prior to version 2.6.0 enables server-side request forgery and local file disclosure through its attachment option, which passes any URL-shaped value through PHP's file_get_contents() without restricting the URL scheme. Applications that expose the attachment option to user-controlled input allow an attacker to probe internal HTTP endpoints (including cloud instance metadata services) and read arbitrary local files by supplying schemes such as file:// or php://filter/..., with exfiltrated content embedded directly into the generated PDF output. This is the same vulnerability class patched in KnpLabs/snappy (GHSA-c5fp-p67m-gq56); no public exploit or CISA KEV listing exists at time of analysis.

RemediationAI

Upgrade pontedilana/php-weasyprint to version 2.6.0 or later via Composer (composer require pontedilana/php-weasyprint:^2.6.0); the vendor-released patch is confirmed at https://github.com/pontedilana/php-weasyprint/releases/tag/2.6.0 with fix commit 9582dcf119a405276cf55e9e10bc577a887792cb. If immediate upgrade is not possible, audit all application code that instantiates Pdf objects and ensure no user-controlled input reaches the attachment option - replace free input with an explicit allowlist of known-safe attachment paths (e.g., map user-supplied keys to server-side file paths, as demonstrated in the KnpLabs/snappy advisory at https://github.com/KnpLabs/snappy/security/advisories/GHSA-c5fp-p67m-gq56). As a defense-in-depth measure, restrict the PHP daemon to the minimum filesystem permissions required and avoid running it as root, which limits the blast radius of any file:// exploitation. In cloud environments, apply network egress controls to block the PHP process from reaching instance metadata endpoints (e.g., 169.254.169.254) until the patch can be applied.

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 is a PHP wrapper library (Composer package pontedilana/php-weasyprint) for the WeasyPrint binary that generates PDFs from HTML or URLs. The vulnerable logic resides in src/Pdf.php: the isOptionUrl() method previously used filter_var($value, FILTER_VALIDATE_URL) to determine whether an option value should be fetched server-side via file_get_contents(). PHP's FILTER_VALIDATE_URL accepts not only http and https but also ftp, file, and stream wrappers such as php://filter/convert.base64-encode/resource=/etc/passwd, creating dual attack primitives: SSRF against internal HTTP services and local file read against the PHP process's accessible filesystem. CWE-918 (Server-Side Request Forgery) identifies the root cause as insufficient validation of user-supplied URLs used in server-side HTTP or filesystem requests. The fix in version 2.6.0 replaces the FILTER_VALIDATE_URL check with a strict scheme allowlist (http and https by default), configurable via a new $allowedSchemes constructor argument, and is confirmed by commit 9582dcf119a405276cf55e9e10bc577a887792cb. CPE: cpe:2.3:a:pontedilana:php-weasyprint:*:*:*:*:*:*:*:*.

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

Requires low-privilege app access to control the attachment option (PR:L); confidentiality is high from arbitrary local file read and SSRF; no integrity or availability impact.

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

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 fetches the content of option values server-side via file_get_contents() when the value looks like a URL, without restricting the URL scheme. The attachment option of Pdf is the reachable sink: any value that passes isOptionUrl() (filter_var(..., FILTER_VALIDATE_URL)) is downloaded by the PHP process and embedded into the generated PDF. Because FILTER_VALIDATE_URL accepts http, https, ftp, file and PHP stream wrappers such as php://, an attacker who can influence the attachment value reaches both a Server-Side Request Forgery primitive (e.g. internal HTTP endpoints, cloud metadata) and a local file disclosure primitive (file://, php://filter/...), with the fetched bytes exfiltrated as a PDF attachment. This is the same class of issue KnpLabs/snappy patched for its xsl-style-sheet option in GHSA-c5fp-p67m-gq56. The library is documented as a one-to-one substitute for KnpLabs/snappy and shares the same code shape. PhpWeasyPrint version 2.6.0 contains a patch for the issue.

Threat Intelligence Overview

EPSS Score
0.2%
Top 85% 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 MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.

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