CVE-2025-68616

WeasyPrint · WeasyPrint Multiple Products

CVE-2025-68616 is a high-severity security vulnerability identified in WeasyPrint, a popular library used by web developers to generate PDF documents from HTML and CSS.

Executive summary

CVE-2025-68616 is a high-severity security vulnerability identified in WeasyPrint, a popular library used by web developers to generate PDF documents from HTML and CSS. If exploited, this flaw could allow an attacker to gain unauthorized access to sensitive internal information or local system files by submitting malicious document requests.

Vulnerability

The vulnerability involves insufficient validation of external resources and URI schemes during the PDF rendering process. An attacker can exploit this by providing specially crafted HTML or CSS input that forces the application to fetch resources from unauthorized locations. This typically manifests as a Server-Side Request Forgery (SSRF) or Local File Inclusion (LFI) vulnerability, where the PDF engine is leveraged to bypass network firewalls or read sensitive files from the local server hosting the application.

Business impact

This vulnerability is classified as High severity with a CVSS score of 7.5. Successful exploitation could lead to the exposure of sensitive internal data, including cloud environment metadata, internal network configurations, or administrative files. For organizations that use WeasyPrint to process user-generated content or automated reports, this poses a significant risk of data exfiltration, potential regulatory non-compliance, and loss of intellectual property.

Remediation

Immediate Action: Apply vendor security updates immediately. Monitor for exploitation attempts and review access logs.

Proactive Monitoring: Security teams should monitor web application logs for unusual outbound connection attempts originating from the PDF generation service, particularly those targeting internal IP ranges (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) or the cloud metadata service (169.254.169.254). Additionally, review generated PDFs for unexpected content that may indicate successful file inclusion.

Compensating Controls: If immediate patching is not feasible, implement strict egress filtering on the server hosting WeasyPrint to block all non-essential outbound traffic. Furthermore, ensure the application is running in a restricted environment or container with minimal filesystem permissions and use a dedicated URL-allowlist to restrict the types of resources the library can fetch.

Exploitation status

Public Exploit Available: false

Analyst recommendation

Organizations should treat this vulnerability with high priority due to its 7.5 CVSS score and the potential for direct data exfiltration. While CVE-2025-68616 is not currently listed on the CISA KEV (Known Exploited Vulnerabilities) catalog, the ease of exploitation associated with SSRF in document generators necessitates urgent patching. We recommend an immediate audit of all internal applications utilizing WeasyPrint to ensure they are updated to the latest secured version.