Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.4%top 65%

CVE-2026-49359: CWE-918: Server-Side Request Forgery (SSRF) in pontedilana php-weasyprint

0
Medium
VulnerabilityCVE-2026-49359cvecve-2026-49359cwe-918
Published: 06/19/2026 (06/19/2026, 17:06:12 UTC)
Source: CVE Database V5
Vendor/Project: pontedilana
Product: php-weasyprint

Description

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.

CVSS v3.1

Score 6.5medium

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

Affected software

Packagistmore threats →ai
pontedilana/php-weasyprint
pkg:composer/pontedilana/php-weasyprint
Affected versions
<2.6.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 06/26/2026, 19:14:48 UTC

Technical Analysis

PhpWeasyPrint is a PHP library for generating PDFs from URLs or HTML pages. Prior to version 2.6.0, it uses file_get_contents() to fetch the content of option values that look like URLs, including the 'attachment' option of the Pdf class. The URL validation relies on FILTER_VALIDATE_URL, which accepts schemes such as http, https, ftp, file, and PHP stream wrappers like php://. This allows an attacker who can influence the 'attachment' option to perform Server-Side Request Forgery (SSRF) by making the server fetch arbitrary internal or external resources, including local files or PHP streams. The fetched content is then embedded as a PDF attachment, enabling exfiltration. This vulnerability is tracked as CVE-2026-49359 and was patched in php-weasyprint version 2.6.0.

Potential Impact

An attacker with the ability to control the 'attachment' option value can cause the server to fetch arbitrary URLs or local files. This can lead to disclosure of sensitive internal resources, local files, or cloud metadata accessible from the server environment. The vulnerability allows exfiltration of the fetched content embedded in generated PDFs. The CVSS 3.1 base score is 6.5 (medium severity), reflecting network attack vector, low attack complexity, low privileges required, no user interaction, and high confidentiality impact without integrity or availability impact.

Mitigation Recommendations

PhpWeasyPrint version 2.6.0 contains a patch that addresses this vulnerability. Users should upgrade to version 2.6.0 or later to remediate this issue. No additional vendor advisory or temporary mitigations are provided. Patch status is confirmed by the version bump and description. Until upgraded, avoid passing untrusted input to the 'attachment' option or restrict URL schemes manually.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-05-29T14:35:45.904Z
Cvss Version
3.1
State
PUBLISHED
Remediation Level
null

Threat ID: 6a358c60f198dc38c1f30251

Added to database: 06/19/2026, 18:37:20 UTC

Last enriched: 06/26/2026, 19:14:48 UTC

Last updated: 08/04/2026, 12:46:13 UTC

Views: 83

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses