{"id":"CVE-2026-49359","published":"2026-06-19T17:06:12Z","modified":"2026-06-23T02:16:42Z","title":"PhpWeasyPrint vulnerable to SSRF and local file disclosure via the attachment option","vendor":"pontedilana","product":"php-weasyprint","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00422,"percentile":0.37421,"provenance":"source"},"cwes":[{"id":"CWE-918","name":"Server-Side Request Forgery"}],"references":[{"url":"https://github.com/pontedilana/php-weasyprint/security/advisories/GHSA-x8g9-h984-pc36","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/KnpLabs/snappy/security/advisories/GHSA-c5fp-p67m-gq56","tags":["x_refsource_MISC"]},{"url":"https://github.com/pontedilana/php-weasyprint/commit/9582dcf119a405276cf55e9e10bc577a887792cb","tags":["x_refsource_MISC"]},{"url":"https://github.com/pontedilana/php-weasyprint/releases/tag/2.6.0","tags":["x_refsource_MISC"]}],"priority":{"score":12.0,"factors":[{"name":"EPSS percentile","points":7.48},{"name":"CVSS severity","points":4.55}]},"vendorSlug":"pontedilana","affectedVersions":[{"vendor":"pontedilana","product":"php-weasyprint","versions":["< 2.6.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-06-23T02:15:43.408580Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"pontedilana/php-weasyprint","vulnerableRanges":["<2.6.0"],"patched":["2.6.0"],"from":["GHSA-x8g9-h984-pc36"],"provenance":"source"}],"summary":{"text":"PhpWeasyPrint, the pontedilana/php-weasyprint PHP library for generating PDFs from URLs or HTML, contains a flaw in versions before 2.6.0 where the attachment option of Pdf fetches any URL-like value server-side via file_get_contents() without restricting the URL scheme. An attacker who can control the attachment value and has low-privileged access to the application can use it to make the server request internal endpoints or cloud metadata (SSRF) or read local files through file:// or php:// wrappers, with the retrieved content returned inside the generated PDF.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:52:23Z"},"euvd":{"id":"EUVD-2026-38054","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-knplabs-snappy-cve-2023-28115","parents":[{"from":"CVE-2026-46683","to":"CVE-2026-49359","relation":"related","confidence":"high","kind":"lineage","evidence":[{"kind":"osv-related","provenance":"source","id":"GHSA-c5fp-p67m-gq56","via":"related"},{"kind":"osv-related","provenance":"source","id":"GHSA-x8g9-h984-pc36","via":"reference","url":"https://github.com/KnpLabs/snappy/security/advisories/GHSA-c5fp-p67m-gq56"}]},{"from":"CVE-2026-49260","to":"CVE-2026-49359","relation":"successor","confidence":"high","kind":"lineage","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:pontedilana/php-weasyprint","fromFixed":"2.5.1","toFixed":"2.6.0","daysApart":0},{"kind":"same-code","provenance":"machine","files":["src/Pdf.php"],"commits":["https://github.com/pontedilana/php-weasyprint/commit/9e86a2b317237fc5728f712f5037164530117f7e","https://github.com/pontedilana/php-weasyprint/commit/9582dcf119a405276cf55e9e10bc577a887792cb"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.37,"basis":"same product + description similarity"}]}],"packageHistory":[{"cve":"CVE-2026-49260","published":"2026-06-19","fixed":"2.5.1","kev":false},{"cve":"CVE-2026-49286","published":"2026-06-19","fixed":"2.6.0","kev":false},{"cve":"CVE-2026-49358","published":"2026-06-19","fixed":"2.6.0","kev":false},{"cve":"CVE-2026-49359","published":"2026-06-19","fixed":"2.6.0","kev":false}],"package":"Packagist:pontedilana/php-weasyprint"}}