Junglewise Threat Intelligence

CVE-2026-55073: WeasyPrint server-side request forgery and local file read via url_fetcher bypass

CVE-2026-55073 · Severity: medium · CVSS 6.2 · Published 2026-09-09

Executive brief

WeasyPrint is a Python library that converts HTML and CSS to PDF documents, widely used in server-side document generation services. Two parameters in the `write_pdf()` method—`xmp_metadata` and `stylesheets`—bypass the application's configured URL access restrictions (url_fetcher), allowing an attacker who controls these parameters to read local files or access internal network resources. Applications that accept user-controlled input for these parameters (e.g., custom PDF rendering APIs, invoice generators) risk exposure of sensitive files like configuration, credentials, or internal secrets embedded in generated PDFs.

Technical details

WeasyPrint provides a `url_fetcher` parameter to restrict which resources (local files, internal hosts) can be loaded during PDF rendering. However, the `write_pdf()` method has two code paths that ignore this restriction: (1) **`xmp_metadata`** parameter calls `select_source()` without passing the document's url_fetcher, causing a permissive default fetcher to be instantiated instead. Attacker-controlled file:// URLs are fetched and their raw bytes are embedded verbatim in the output PDF, enabling arbitrary local file disclosure. (2) **`stylesheets`** parameter similarly omits the url_fetcher argument when instantiating CSS objects, allowing blocked file:// URLs to be loaded and applied. This is transitive—CSS @import rules inherit the permissive fetcher and propagate the bypass through the entire stylesheet import graph. Both vulnerabilities require the application to forward untrusted user input into these parameters, which is common in server-side PDF generation services (invoice/report generators, document SaaS platforms). No network requirements; attacks work against any file readable by the rendering process. Fixed in WeasyPrint 70.0 by routing both call sites through the document's url_fetcher.

Affected products

  • Kozea WeasyPrint < 70.0

Timeline

  • 2026-09-09: disclosed: Vulnerability disclosed in GitHub Advisory GHSA-jf6q-chmf-3h3v / CVE-2026-55073
  • 2026-09-09: patched: Fixed in WeasyPrint version 70.0

References

Related threats