Cross-site Scripting (XSS) Affecting lxml-html-clean package, versions <0.4.1-1


Severity

Recommended
0.0
medium
0
10

Snyk's Security Team recommends NVD's CVSS assessment. Learn more

Threat Intelligence

EPSS
0.06% (30th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Scripting (XSS) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-DEBIAN13-LXMLHTMLCLEAN-8400808
  • published23 Nov 2024
  • disclosed19 Nov 2024

Introduced: 19 Nov 2024

CVE-2024-52595  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

Upgrade Debian:13 lxml-html-clean to version 0.4.1-1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream lxml-html-clean package and not the lxml-html-clean package as distributed by Debian. See How to fix? for Debian:13 relevant fixed versions and status.

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 &lt;svg&gt;, &lt;math&gt; and &lt;noscript&gt;. 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 &lt;svg&gt;, &lt;math&gt; and &lt;noscript&gt;.

CVSS Scores

version 3.1