CVE-2026-49452
Published:July 06, 2026
Updated:July 15, 2026
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)
Affected Packages
weasyprint (CONDA):
Affected version(s) >=47 <69.0Fix Suggestion:
Update to version 69.0weasyprint (PYTHON):
Affected version(s) >=47 <69.0Fix Suggestion:
Update to version 69.0Related Resources (5)
Do you need more information?
Contact UsCVSS v4
Base Score:
6.9
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
LOW
Vulnerable System Integrity
LOW
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
6.5
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
LOW
Integrity
LOW
Availability
NONE
Weakness Type (CWE)
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')