CVE-2021-43818:
lxml's HTML Cleaner allows crafted and SVG embedded scripts to pass through
8.2
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.84262%
CWE
Published
12/13/2021
Updated
9/30/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
lxml | pip | < 4.6.5 | 4.6.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key functions in the HTML cleaner: 1) _has_sneaky_javascript lacked '@import' detection in CSS, letting attackers bypass sanitization through crafted style content. 2) _is_javascript_scheme improperly handled SVG data URIs due to insufficient image type validation. These are confirmed by the commit diffs showing added '@import' checks and SVG data URI validation, and CWE-79/CWE-74 mappings align with XSS and injection vectors through these functions.