{"schemaVersion":3,"id":"CVE-2024-52595","aliases":["GHSA-5jfw-gq64-q45f","PYSEC-2024-160","UBUNTU-CVE-2024-52595","DEBIAN-CVE-2024-52595"],"status":"published","duplicateOf":null,"title":null,"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>`.","dates":{"published":"2024-11-19T21:27:08.871Z","modified":"2024-11-20T15:19:10.677Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7.7,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":7.7,"severity":"high","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:H","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Pypi","score":6.1,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","exploitability":7.2,"impact":4.5,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":6.1,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","exploitability":7.2,"impact":4.5,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Debian","score":6.1,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","exploitability":7.2,"impact":4.5,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":6.1,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00479,"percentile":0.40021,"severity":"low","asOf":"2026-10-19T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-19T00:00:00.000Z","baselineScore":0.00479},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00479,"percentile":0.40021}],"last30":[{"date":"2026-09-19T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00479,"percentile":0.40021}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')","description":"The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.","type":"weakness","status":"Stable","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-83","name":"Improper Neutralization of Script in Attributes in a Web Page","description":"The product does not neutralize or incorrectly neutralizes \"javascript:\" or other URIs from dangerous attributes within tags, such as onmouseover, onload, onerror, or style.","type":"weakness","status":"Draft","abstraction":"Variant","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/83.html"},{"id":"CWE-184","name":"Incomplete List of Disallowed Inputs","description":"The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/184.html"}],"affected":[{"vendor":"debian","product":"lxml-html-clean","name":"lxml-html-clean","label":"lxml-html-clean","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/lxml-html-clean","purlType":"deb","versions":[{"text":"< 0.4.1-1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 0.4.1-1","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"lxml-html-clean","name":"lxml-html-clean","label":"lxml-html-clean","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/lxml-html-clean","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"All versions (No fix recorded)","eol":null,"hubHref":null},{"vendor":"fedora-python","product":"lxml_html_clean","name":"lxml_html_clean","label":"lxml_html_clean","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 0.4.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 0.4.0","eol":null,"hubHref":"/vendor/fedora-python/lxml_html_clean"},{"vendor":"fedoralovespython","product":"lxml_html_clean","name":"lxml html clean","label":"lxml_html_clean","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 0.4.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 0.4.0","eol":null,"hubHref":"/vendor/fedoralovespython/lxml_html_clean"},{"vendor":"PyPI","product":"lxml-html-clean","name":"lxml-html-clean","label":"lxml-html-clean","ecosystem":"PyPI","cpePart":null,"purl":"pkg:pypi/lxml-html-clean","purlType":"pypi","versions":[{"text":"< c5d816f86eb3707d72a8ecf5f3823e0daa1b3808","noFixRecorded":false,"fixedIn":null},{"text":"< 0.4.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< c5d816f86eb3707d72a8ecf5f3823e0daa1b3808 | < 0.4.0","eol":null,"hubHref":null}],"affectedCount":5,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/fedora-python/lxml_html_clean/security/advisories/GHSA-5jfw-gq64-q45f","label":"github.com/fedora-python/lxml_html_clean/security/advisories/GHSA-5jfw-gq64-q45f","hostname":"github.com","tags":["X Refsource CONFIRM","WEB","Advisory","REPORT","Mitigation","Vendor Advisory"]},{"url":"https://github.com/fedora-python/lxml_html_clean/pull/19","label":"github.com/fedora-python/lxml_html_clean/pull/19","hostname":"github.com","tags":["X Refsource MISC","WEB","FIX","REPORT","Patch"]},{"url":"https://github.com/fedora-python/lxml_html_clean/commit/c5d816f86eb3707d72a8ecf5f3823e0daa1b3808","label":"github.com/fedora-python/lxml_html_clean/commit/c5d816f86eb3707d72a8ecf5f3823e0daa1b3808","hostname":"github.com","tags":["X Refsource MISC","WEB","FIX","REPORT","Patch"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-52595","label":"nvd.nist.gov/vuln/detail/CVE-2024-52595","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/fedora-python/lxml_html_clean","label":"github.com/fedora-python/lxml_html_clean","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/lxml-html-clean/PYSEC-2024-160.yaml","label":"github.com/pypa/advisory-database/tree/main/vulns/lxml-html-clean/PYSEC-2024-160.yaml","hostname":"github.com","tags":["WEB"]},{"url":"https://ubuntu.com/security/CVE-2024-52595","label":"ubuntu.com/security/CVE-2024-52595","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2024-52595","label":"www.cve.org/CVERecord?id=CVE-2024-52595","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2024-52595","label":"security-tracker.debian.org/tracker/CVE-2024-52595","hostname":"security-tracker.debian.org","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2024-11-19T21:27:08.871Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-11-20T15:19:10.677Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":31,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T05:39:28.147Z","stale":false,"partial":false}}