{"schemaVersion":4,"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":"HTML Cleaner allows crafted scripts in special contexts like svg or math to pass through","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.00508,"percentile":0.44925,"severity":"low","asOf":"2026-12-04T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-11-04T00:00:00.000Z","baselineScore":0.00508},"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":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-22T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-23T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-24T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-25T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-26T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-27T00:00:00.000Z","score":0.00479,"percentile":null},{"date":"2026-10-28T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-10-29T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-10-30T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-10-31T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-01T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-02T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-03T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-04T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00508,"percentile":0.44925}],"last30":[{"date":"2026-11-04T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-05T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-06T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-07T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-08T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-09T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-10T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-11T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-12T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-13T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-14T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-15T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-16T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-17T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-18T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-19T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-20T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-21T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-22T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-23T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-24T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-11-25T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-26T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.0096,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00508,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00508,"percentile":0.44925}]},"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","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,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"0.4.1-1","endInclusive":false}}],"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,"bounds":{"kind":"all"}}],"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,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"0.4.0","endInclusive":false}}],"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,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"0.4.0","endInclusive":false}}],"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,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"c5d816f86eb3707d72a8ecf5f3823e0daa1b3808","endInclusive":false}},{"text":"< 0.4.0","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"0.4.0","endInclusive":false}}],"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}],"priority":{"label":"prioritise","tag":"severe","reason":"Severe, CVSS 7.7 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 04-12-2026)","nextStep":"Check applicability: affected before 0.4.0 (CNA); fix release not confirmed","rank":[0,0,0,0,1,77],"checkedSources":["cisa","enisa","circl","shadowserver","cisa-adp"],"evidence":[{"type":"epss","source":"FIRST","date":"2026-12-04T00:00:00.000Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"value":0.00508,"stale":false,"promoted":null},{"type":"cvss","source":"cve.org","date":"2024-11-20T15:19:10.677Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":7.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:H","version":"3.1","headline":true},{"type":"cvss","source":"osv_pypi","date":"2024-11-20T15:19:10.677Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","version":"3.1"},{"type":"cvss","source":"osv_ubuntu","date":"2024-11-20T15:19:10.677Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","version":"3.1"},{"type":"cvss","source":"osv_debian","date":"2024-11-20T15:19:10.677Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","version":"3.1"},{"type":"cvss","source":"nvd","date":"2024-11-20T15:19:10.677Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","version":"3.1"},{"type":"adp","source":"cisa-adp","date":"2024-11-20T15:18:41.666Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"exploitation":"none"}],"epss":{"value":0.00508,"date":"2026-12-04T00:00:00.000Z","stale":false,"promoted":null},"sources":[{"id":"cisa","lastSuccessfulSync":"2026-12-05T06:02:28.822Z","state":"fresh"},{"id":"enisa","lastSuccessfulSync":"2026-12-05T06:02:29.295Z","state":"fresh"},{"id":"circl","lastSuccessfulSync":"2026-12-05T06:02:29.506Z","state":"fresh"},{"id":"shadowserver","lastSuccessfulSync":null,"state":"unavailable"},{"id":"cisa-adp","lastSuccessfulSync":"2026-12-05T06:00:56.363Z","state":"fresh"},{"id":"epss","lastSuccessfulSync":"2026-12-05T06:02:27.202Z","state":"fresh"},{"id":"osv","lastSuccessfulSync":"2026-12-05T06:02:26.240Z","state":"fresh"}],"feedEvent":null},"meta":{"dataAsOf":"2026-12-05T06:44:50.289Z","stale":false,"partial":false}}