Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2024-52595

HIGH 7.7EPSS 60%

HTML Cleaner allows crafted scripts in special contexts like svg or math to pass through

Also known as GHSA-5jfw-gq64-q45f, PYSEC-2024-160

Mitigation

  • Upgrade lxml-html-clean to 0.4.0 or later.

Who should check

  • Projects that depend on PyPI package lxml-html-clean (< 0.4.0)
  • Anyone running fedora-python lxml_html_clean < 0.4.0

Vulnerability facts

Affected
lxml-html-clean < 0.4.0
Fixed in
0.4.0
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
7.7 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: High
  • Privileges required: None
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: Low
  • Availability impact: High
EPSS
0.96% chance of exploitation in 30 days (percentile 60, 2026-11-26)
CWE
CWE-79, CWE-83, CWE-184
Published
Modified

Description

lxml_html_clean is a project for HTML cleaning functionalities copied from `lxml.html.clean`. Prior to version 0.4.0, the HTML Parser in lxml does not properly handle context-switching for special HTML tags such as `<svg>`, `<math>` and `<noscript>`. This behavior deviates from how web browsers parse and interpret such tags. Specifically, content in CSS comments is ignored by lxml_html_clean but may be interpreted differently by web browsers, enabling malicious scripts to bypass the cleaning process. This vulnerability could lead to Cross-Site Scripting (XSS) attacks, compromising the security of users relying on lxml_html_clean in default configuration for sanitizing untrusted HTML content. Users employing the HTML cleaner in a security-sensitive context should upgrade to lxml 0.4.0, which addresses this issue. As a temporary mitigation, users can configure lxml_html_clean with the following settings to prevent the exploitation of this vulnerability. Via `remove_tags`, one may specify tags to remove - their content is moved to their parents' tags. Via `kill_tags`, one may specify tags to be removed completely. Via `allow_tags`, one may restrict the set of permissible tags, excluding context-switching tags like `<svg>`, `<math>` and `<noscript>`.

Affected and fixed versions

Package / productAffectedFixedSource
PyPI lxml-html-clean< 0.4.00.4.0osv
fedora-python lxml_html_clean< 0.4.0—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2024-52595. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-52595.md
Affected: lxml-html-clean < 0.4.0
Fixed in: 0.4.0

Steps:
1. Search this machine and project for lxml-html-clean (PyPI), fedora-python lxml_html_clean: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2024-52595 being exploited?

There is no confirmed exploitation: CVE-2024-52595 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.96% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2024-52595?

High: CVSS 7.7 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.

Which versions are affected by CVE-2024-52595?

lxml-html-clean < 0.4.0.

Is there a fix for CVE-2024-52595?

Yes. Fixed in 0.4.0. Upgrade lxml-html-clean to 0.4.0 or later.

How do I check if I'm affected by CVE-2024-52595?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors