Skip to main content
VulnerabilityPublished

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

Affects weasyprintSource GCVE Database

0
Compare
Authoritative record:CVE-2026-49452· Medium 6.5

Not known to be exploited · CVSS 6.5 Medium.

Data as of 30 Oct 2026, 11:52 UTC

CVSS 3.1 base score
6.5Medium
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.3% chance of exploitation in 30 days – higher than 31% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Exploitation evidence

t = 0 is the CVE’s publication on cve.org

  1. Disclosed: evidence found.

    CVE published 18 Aug 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: evidence found.

    CISA SSVC: proof of concept public

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

Timeline

  1. CVE ID reserved

    by GitHub, Inc.

    , 80 days before disclosure

  2. CVE published

    on cve.org

    , t = 0

  3. CISA SSVC assessment

    proof of concept public

    , 21 hours after disclosure

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), CISA SSVC, the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.

What to do

Affected software

ProductAffectedFixed in
PyPIweasyprintAffected
  • <=68.1
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

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 - Escape attribute values before embedding into CSS - Restrict allowed values for presentational hints [VULN-05_css_injection_presentational_hints.md](https://github.com/user-attachments/files/26370718/VULN-05_css_injection_presentational_hints.md)

References

Community reviews

Loading reviews…