CVE-2026-49359: CWE-918: Server-Side Request Forgery (SSRF) in pontedilana php-weasyprint
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.
AI Analysis
Technical Summary
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.
CVE-2026-49359: CWE-918: Server-Side Request Forgery (SSRF) in pontedilana 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
Affected software
pkg:composer/pontedilana/php-weasyprintRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
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.
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.