CVE-2026-49359: pontedilana PhpWeasyPrint SSRF and local file disclosure in attachment option

CVE-2026-49359 · Severity: medium · CVSS 6.5 · Published 2026-06-19

PhpWeasyPrint, a library used to generate PDF documents, contains a vulnerability that allows attackers to force the server to download files or access internal network resources. By providing a specially crafted URL as a PDF attachment, an attacker can trick the system into including sensitive local files or internal data directly inside the generated PDF. This could lead to the exposure of private configuration files, credentials, or internal service data.

Technologies: pontedilana/php-weasyprint (Packagist), Pontedilana Php-Weasyprint. Vendors: Packagist, Pontedilana.

Quick answers

Is CVE-2026-49359 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-49359 being exploited in the wild.
How severe is CVE-2026-49359?
Medium severity, with a CVSS score of 6.5, published 19 June 2026.
Which products and versions are affected?
pontedilana/php-weasyprint (Packagist) <= 2.5.1, ECOSYSTEM:introduced=0,fixed=2.6.0; Pontedilana Php-Weasyprint < 2.6.0.
Is there a fix for CVE-2026-49359?
Yes. pontedilana/php-weasyprint (Packagist): upgrade to 2.6.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-49359 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-49359?
Check whether you run pontedilana/php-weasyprint (Packagist) or Pontedilana Php-Weasyprint at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • pontedilana/php-weasyprint (Packagist): upgrade to 2.6.0 or later
    composer require pontedilana/php-weasyprint:^2.6.0

Technical details

The vulnerability exists in the `isOptionUrl()` and `handleArrayOptions()` methods within `src/Pdf.php`. The library uses `filter_var()` with `FILTER_VALIDATE_URL` to determine if an attachment value is a URL, and if so, fetches its content using `file_get_contents()`. Because the library does not restrict the URL schemes, an attacker can use `file://`, `ftp://`, or PHP stream wrappers like `php://filter/` to exfiltrate local files or perform SSRF against internal endpoints. The fetched content is then embedded as an attachment in the resulting PDF. This issue is patched in version 2.6.0 by implementing a scheme allow-list (defaulting to http/https).

Affected products

  • pontedilana php-weasyprint <= 2.5.1

Identifiers

  • CVE-2026-49359
  • GHSA-x8g9-h984-pc36

Timeline

  • 2026-05-25: disclosed: Advisory published by maintainer
  • 2026-06-19: advisory: NVD published CVE-2026-49359
  • 2026-06-26: patched: GitHub Advisory reviewed and updated with patch information

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.