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
Share

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

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

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 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.

AnalysisAI

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.

Technical ContextAI

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:*:*:*:*:*:*:*:*.

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.

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

CVE-2026-49359 vulnerability details – vuln.today

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