WeasyPrint: CSS Injection via Presentational Hints
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
WeasyPrint helps web developers to create PDF documents. Prior to 69.0, WeasyPrint embeds unescaped HTML presentational-hint attribute values into CSS in weasyprint/css/__init__.py when presentational_hints=True. The background attribute is inserted into a background-image:url() declaration and parsed by tinycss2.parse_blocks_contents(), allowing untrusted HTML to inject additional CSS declarations. Applications that render untrusted HTML with presentational hints enabled can be affected by CSS injection and server-side requests through injected url() values. This issue is fixed in version 69.0.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Kozea | WeasyPrint | before 69.0 | 69.0 | Patch available | CNA |
| — | weasyprint (PyPI) | up to 68.1 | — | No fix listed | GHSA-jhhc-3hcp-qhm5 |
- WeasyPrint VendorKozea Affected before 69.0 Fixed in 69.0 Patch available CNA
- weasyprint (PyPI) Vendor— Affected up to 68.1 Fixed in — No fix listed GHSA-jhhc-3hcp-qhm5
Remediation
- Fix · CNA WeasyPrint (Kozea) Fixed in 69.0
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
Not affected: 1 product
- Red Hat Ansible Automation Platform 2
Timeline
- 2026-10-02 Threatist record created from CVE-2026-49452
- 2026-10-03 Alias added: GHSA-jhhc-3hcp-qhm5
References
More Kozea vulnerabilities
- TI-2026-69644 Inefficient path parsing in CairoSVG enables denial of service CVSS 4.0HIGH 8.7
- TI-2026-24451 CairoSVG vulnerable to Exponential DoS via recursive <use> element amplification CVSS 3.1HIGH 7.5
- TI-2025-42134 WeasyPrint Vulnerable to Server-Side Request Forgery (SSRF) Protection Bypass via HTTP Redirect CVSS 3.1HIGH 7.5
- TI-2026-39778 WeasyPrint restrictive URL fetcher bypass allows local file read and SSRF CVSS 3.1MEDIUM 6.2
- TI-2023-12296 CairoSVG improperly processes SVG files loaded from external resources CVSS 3.1CRITICAL 9.9
- TI-2026-68895 WeasyPrint passes EPS images to Ghostscript, risking code execution CVSS 3.1HIGH 8.8
Sources
- CVE-2026-49452 · CVE Program
- CVE-2026-49452 · NVD
- FIRST EPSS
- GHSA-jhhc-3hcp-qhm5 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-49452 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences