Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
MEDIUM severity

CVE-2026-49452 — weasyprint

MEDIUMFix: Kozea/WeasyPrint@e158264

CVE-2026-49452 is a medium-severity (CVSS 6.5) CWE-74 vulnerability in weasyprint. No vendor fix is recorded yet; mitigation options are listed below.

WeasyPrint: CSS Injection via Presentational Hints

Also known asGHSA-jhhc-3hcp-qhm5PYSEC-2026-3412
Published
Updated
Affected
1 pkg
Patched
See advisory
Exploits
None indexed
Exploitation data as of Oct 24, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-49452.

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs30th percentile — riskier than 30% of all scored CVEsHighest risk
0.00%0.29%0.58%0.87%0.3%0.4%0.4%Sep 26Oct 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2026-49452 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

1 pkg affected
🐍weasyprint

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Summary

A CSS injection issue exists in WeasyPrint when HTML presentational hints are enabled. Unescaped attribute values are embedded into CSS, allowing injection of arbitrary CSS declarations. This affects applications processing untrusted HTML input.

Details

File: weasyprint/css/init.py

The background attribute is used to construct CSS:

background-image:url({element.get("background")})

This string is parsed by tinycss2.parse_blocks_contents().

Because the value is not escaped, additional CSS declarations can be injected.

PoC

<body background="x);background-image:url(http://169.254.169.254/latest/meta-data/)">

Impact

  • CSS injection
  • Server-side requests via injected url()
  • Limited to cases where presentational_hints=True

Suggested Fix

Affected Packages

1 total
EcosystemPackageVulnerable rangeFix
🐍PyPIweasyprintall versionsNo fix

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for weasyprint, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Remediation status

    No patched version of weasyprint has shipped for CVE-2026-49452 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.

  3. Mitigate without a patch

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatModerate

Red Hat Ansible Automation Platform 2.5 ships WeasyPrint 69.0, which already includes the fix for this vulnerability, and is therefore not affected. The WeasyPrint package in EPEL ships a version within the vulnerable range.

Workaround published by Red Hat
Escape attribute values before embedding into CSS, and restrict allowed values for presentational hints.
Source: Red Hat security advisory for CVE-2026-49452 (CC BY 4.0)

Frequently Asked Questions

### Summary A CSS injection issue exists in WeasyPrint when HTML presentational hints are enabled. Unescaped attribute values are embedded into CSS, allowing injection of arbitrary CSS declarations. This affects applications processing untrusted HTML input. ### Details File: weasyprint/css/__init__.py The `background` attribute is used to construct CSS: background-image:url({element.get("background")}) This string is parsed by `tinycss2.parse_blocks_contents()`. Because the value is not escaped, additional CSS declarations can be injected. ### PoC <body background="x);background-image:ur
O3 Security · Impact-Aware SCA

Is CVE-2026-49452 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2026-49452: weasyprint (Medium 6.5)