PyPI: weasyprint

CVE-2024-28184

Safety vulnerability ID: SFTY-20240309-67265

Safety legacy ID: pyup.io-71637

Affected versions of WeasyPrint are vulnerable to an arbitrary file content attachment vulnerability. This issue enables attackers to attach content from arbitrary files and URLs to generated PDF documents, bypassing restrictions imposed by the configured `url_fetcher`. The attack vector exploits weaknesses in WeasyPrint’s file and URL handling during PDF generation. Mitigation involves upgrading to version 61.2 or later, which patches the vulnerability and reinforces content source validation for secure PDF creation. This vulnerability specifically impacts web developers using WeasyPrint for PDF document generation.

Created at: Jul 5, 2026Updated at: Jul 5, 2026

Overview

WeasyPrint allows the attachment of arbitrary files and URLs to a PDF

Advisory

Affected versions of WeasyPrint are vulnerable to an arbitrary file content attachment vulnerability. This issue enables attackers to attach content from arbitrary files and URLs to generated PDF documents, bypassing restrictions imposed by the configured `url_fetcher`. The attack vector exploits weaknesses in WeasyPrint’s file and URL handling during PDF generation. Mitigation involves upgrading to version 61.2 or later, which patches the vulnerability and reinforces content source validation for secure PDF creation. This vulnerability specifically impacts web developers using WeasyPrint for PDF document generation.

Affected Package

Affecting weasyprint package, versions>=61.0,<=61.1

Also affects

---

How to Fix

Upgradeweasyprintto61.2or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more