# CVE-2026-49452: Kozea WeasyPrint CSS injection in presentational hints

Source: https://junglewise.ai/threats/cve-2026-49452-kozea-weasyprint-css-injection-in-presentational-hints  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-06. Updated: 2026-07-06  
License: CC BY 4.0 with a link back

CVE-2026-49452 · Severity: medium · CVSS 6.5 · Published 2026-07-06

WeasyPrint, a tool used to convert HTML and CSS into PDF documents, contains a vulnerability when processing certain HTML attributes. If an application uses WeasyPrint to process untrusted user content, an attacker could inject malicious styling instructions. This can be used to trigger unauthorized network requests from the server, potentially exposing internal metadata or other sensitive information.

Technologies: [Kozea Weasyprint](https://junglewise.ai/threats/technologies/weasyprint), [weasyprint (PyPI)](https://junglewise.ai/threats/technologies/pypi-weasyprint). Vendors: [Kozea](https://junglewise.ai/threats/vendors/kozea), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-49452 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-49452 being exploited in the wild.

**How severe is CVE-2026-49452?** Medium severity, with a CVSS score of 6.5, published 6 July 2026.

**Which products and versions are affected?** Kozea Weasyprint <= 68.1; weasyprint (PyPI) ECOSYSTEM:introduced=0,last_affected=68.1.

**Is there a fix for CVE-2026-49452?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-49452 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-49452?** Check whether you run Kozea Weasyprint or weasyprint (PyPI) 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.

## Technical details

A CSS injection vulnerability exists in WeasyPrint's 'presentational hints' feature, specifically within 'weasyprint/css/__init__.py'. When 'presentational_hints=True' is configured, the library fails to properly escape HTML attribute values (such as the 'background' attribute) before embedding them into CSS 'url()' declarations. An attacker can provide a crafted HTML input to break out of the intended CSS property and inject arbitrary declarations. This can lead to Server-Side Request Forgery (SSRF) if the attacker injects 'url()' values pointing to internal network resources. As of the advisory date, no patched version is specified.

## Affected products

- Kozea WeasyPrint <= 68.1

## Identifiers

- CVE-2026-49452
- GHSA-jhhc-3hcp-qhm5
- PYSEC-2026-3412

## Timeline

- 2026-06-02: disclosed: Vulnerability reported to maintainer
- 2026-07-06: advisory: GitHub Advisory published

## References

- [https://api.github.com/users/AyushParkara](https://api.github.com/users/AyushParkara)
- [https://github.com/AyushParkara](https://github.com/AyushParkara)
- [https://api.github.com/users/AyushParkara/gists%7B/gist_id%7D](https://api.github.com/users/AyushParkara/gists%7B/gist_id%7D)
- [https://api.github.com/users/AyushParkara/repos](https://api.github.com/users/AyushParkara/repos)
- [https://avatars.githubusercontent.com/u/100233436?v=4](https://avatars.githubusercontent.com/u/100233436?v=4)
- [https://api.github.com/users/AyushParkara/events%7B/privacy%7D](https://api.github.com/users/AyushParkara/events%7B/privacy%7D)

## Related threats

- [WeasyPrint arbitrary code execution via EPS image processing](https://junglewise.ai/threats/cve-2026-106443-weasyprint-helps-web-developers-to-create-pdf-documents-prior-to)
- [WeasyPrint server-side request forgery and local file read via url_fetcher bypass](https://junglewise.ai/threats/cve-2026-55073-weasyprint-server-side-request-forgery-and-local-file-read-via)
- [PYSEC-2026-2033 - WeasyPrint allows the attachment of arbitrary files and URLs to a PDF](https://junglewise.ai/threats/cve-2024-28184-weasyprint-arbitrary-file-attachment-in-pdf-generation)
- [Kozea WeasyPrint SSRF bypass in default_url_fetcher](https://junglewise.ai/threats/cve-2025-68616-kozea-weasyprint-ssrf-bypass-in-default-url-fetcher)
