{"id":"CVE-2021-43818","published":"2021-12-13T18:05:12Z","modified":"2025-12-18T15:05:59Z","title":"HTML Cleaner allows crafted and SVG embedded scripts to pass through","vendor":"lxml","product":"lxml","tier":"tail","description":{"text":"lxml is a library for processing XML and HTML in the Python language. Prior to version 4.6.5, the HTML Cleaner in lxml.html lets certain crafted script content pass through, as well as script content in SVG files embedded using data URIs. Users that employ the HTML cleaner in a security relevant context should upgrade to lxml 4.6.5 to receive a patch. There are no known workarounds available.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.2,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.02663,"percentile":0.85672,"provenance":"source"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"},{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/lxml/lxml/security/advisories/GHSA-55x5-fj6c-h6m8","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/lxml/lxml/commit/12fa9669007180a7bb87d990c375cf91ca5b664a","tags":["x_refsource_MISC"]},{"url":"https://github.com/lxml/lxml/commit/a3eacbc0dcf1de1c822ec29fb7d090a4b1712a9c#diff-59130575b4fb2932c957db2922977d7d89afb0b2085357db1a14615a2fcad776","tags":["x_refsource_MISC"]},{"url":"https://github.com/lxml/lxml/commit/f2330237440df7e8f39c3ad1b1aa8852be3b27c0","tags":["x_refsource_MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZQ4SPKJX3RRJK4UWA6FXCRHD2TVRQI44/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WZGNET2A4WGLSUXLBFYKNC5PXHQMI3I7/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/12/msg00037.html","tags":["mailing-list","x_refsource_MLIST"]},{"url":"https://www.debian.org/security/2022/dsa-5043","tags":["vendor-advisory","x_refsource_DEBIAN"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TUIS2KE3HZ2AAQKXFLTJFZPP2IFHJTC7/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/V2XMOM5PFT6U5AAXY6EFNT5JZCKKHK2V/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://www.oracle.com/security-alerts/cpuapr2022.html","tags":["x_refsource_MISC"]},{"url":"https://security.netapp.com/advisory/ntap-20220107-0005/","tags":["x_refsource_CONFIRM"]},{"url":"https://www.oracle.com/security-alerts/cpujul2022.html","tags":["x_refsource_MISC"]},{"url":"https://security.gentoo.org/glsa/202208-06","tags":["vendor-advisory","x_refsource_GENTOO"]}],"priority":{"score":22.9,"factors":[{"name":"EPSS percentile","points":17.13},{"name":"CVSS severity","points":5.74}]},"vendorSlug":"lxml","affectedVersions":[{"vendor":"lxml","product":"lxml","versions":["< 4.6.5"]}],"affected":[{"ecosystem":"PyPI","package":"lxml","vulnerableRanges":["<4.6.5"],"patched":["4.6.5"],"from":["GHSA-55x5-fj6c-h6m8","PYSEC-2021-852"],"provenance":"source"}],"euvd":{"id":"EUVD-2021-0117","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-lxml-cve-2020-27783","parents":[{"from":"CVE-2021-28957","to":"CVE-2021-43818","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:lxml","fromFixed":"4.6.3","toFixed":"4.6.5","daysApart":267},{"kind":"same-code","provenance":"machine","files":["src/lxml/__init__.py"],"commits":["https://github.com/lxml/lxml/commit/10ec1b4e9f93713513a3264ed6158af22492f270","https://github.com/lxml/lxml/commit/a5f9cb52079dc57477c460dbe6ba0f775e14a999","https://github.com/lxml/lxml/commit/12fa9669007180a7bb87d990c375cf91ca5b664a","https://github.com/lxml/lxml/commit/a3eacbc0dcf1de1c822ec29fb7d090a4b1712a9c"],"basis":"rarely changed file"}]},{"from":"CVE-2020-27783","to":"CVE-2021-43818","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/lxml/html/clean.py"],"commits":["https://github.com/lxml/lxml/commit/a105ab8dc262ec6735977c25c13f0bdfcdec72a7","https://github.com/lxml/lxml/commit/12fa9669007180a7bb87d990c375cf91ca5b664a","https://github.com/lxml/lxml/commit/a3eacbc0dcf1de1c822ec29fb7d090a4b1712a9c"],"basis":"shared function","functions":["_has_sneaky_javascript"]}]}],"packageHistory":[{"cve":"CVE-2018-19787","published":"2018-12-02","fixed":"4.2.5","kev":false},{"cve":"CVE-2020-27783","published":"2020-12-03","fixed":"4.6.2","kev":false},{"cve":"CVE-2021-28957","published":"2021-03-21","fixed":"4.6.3","kev":false},{"cve":"CVE-2021-43818","published":"2021-12-13","fixed":"4.6.5","kev":false},{"cve":"CVE-2022-2309","published":"2022-07-05","fixed":"4.9.1","kev":false,"link":{"from":"CVE-2021-43818","to":"CVE-2022-2309","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:lxml","fromFixed":"4.6.5","toFixed":"4.9.1","daysApart":204}]}},{"cve":"CVE-2026-41066","published":"2026-04-24","fixed":"6.1.0","kev":false}],"package":"PyPI:lxml"}}