{"id":"CVE-2021-28957","aliases":["CVE-2021-28957","GHSA-jq4v-f5q6-mjqq","PYSEC-2021-19"],"related":[],"kind":"vulnerability","state":"published","title":"lxml vulnerable to Cross-Site Scripting","summary":"An XSS vulnerability was discovered in python-lxml's clean module versions before 4.6.3. When disabling the safe_attrs_only and forms arguments, the Cleaner class does not remove the formaction attribute allowing for JS to bypass the sanitizer. A remote attacker could exploit this flaw to run arbitrary JS code on users who interact with incorrectly sanitized HTML. This issue is patched in lxml 4.6.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An XSS vulnerability was discovered in python-lxml's clean module versions before 4.6.3. When disabling the safe_attrs_only and forms arguments, the Cleaner class does not remove the formaction attribute allowing for JS to bypass the sanitizer. A remote attacker could exploit this flaw to run arbitrary JS code on users who interact with incorrectly sanitized HTML. This issue is patched in lxml 4.6.3.","source":"cvelist"},{"lang":"en","text":"An XSS vulnerability was discovered in the python `lxml` clean module versions before 4.6.3. When disabling `the safe_attrs_only` and `forms` arguments, the `Cleaner` class does not remove the `formaction` attribute allowing for JS to bypass the sanitizer. A remote attacker could exploit this flaw to run arbitrary JS code on users who interact with incorrectly sanitized HTML. This issue is patched in `lxml` 4.6.3.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se ha descubierto una vulnerabilidad XSS en las versiones del módulo clean de python-lxml anteriores a la versión 4.6.3. Al desactivar los argumentos safe_attrs_only y forms, la clase Cleaner no elimina el atributo formaction, lo que permite que JS eluda el sanitizador. Un atacante remoto podría aprovechar este fallo para ejecutar código JS arbitrario en usuarios que interactúen con HTML incorrectamente saneado. Este problema está parcheado en lxml  versión 4.6.3","source":"nvd"}],"published":"2021-03-21T04:39:35.000Z","modified":"2026-06-17T03:47:04.717Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.6.3"}],"ecosystem":"PyPI","package":"lxml","purl":"pkg:pypi/lxml","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.6.3"}],"vendor":"lxml","product":"lxml","cpe":"cpe:2.3:a:lxml:lxml:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"9.0"},{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"33"},{"status":"affected","version":"34"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[],"vendor":"netapp","product":"snapcenter","cpe":"cpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"8.8"}],"vendor":"oracle","product":"zfs_storage_appliance_kit","cpe":"cpe:2.3:a:oracle:zfs_storage_appliance_kit:8.8:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"a5f9cb52079dc57477c460dbe6ba0f775e14a999"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.6.3"}],"ecosystem":"PyPI","package":"lxml","purl":"pkg:pypi/lxml","repo":"https://github.com/lxml/lxml","source":"pysec"}],"references":[{"url":"https://bugs.launchpad.net/lxml/+bug/1888153","tags":["exploit","issue-tracking","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/lxml/lxml/pull/316/commits/10ec1b4e9f93713513a3264ed6158af22492f270","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/03/msg00031.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.debian.org/security/2021/dsa-4880","tags":["advisory","third-party-advisory","vendor-advisory","web","x-refsource-debian","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3C2R44VDUY7FJVMAVRZ2WY7XYL4SVN45/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XXN3QPWCTQVOGW4BMWV3AUUZZ4NRZNSQ/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://www.oracle.com/security-alerts/cpuoct2021.html","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/lxml/lxml/commit/a5f9cb52079dc57477c460dbe6ba0f775e14a999","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://security.netapp.com/advisory/ntap-20210521-0004/","tags":["third-party-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://security.gentoo.org/glsa/202208-06","tags":["third-party-advisory","vendor-advisory","web","x-refsource-gentoo","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28957","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/lxml/lxml/pull/316","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/lxml/lxml/commit/2d01a1ba8984e0483ce6619b972832377f208a0d","tags":["web"],"sources":["ghsa"]},{"url":"https://security.netapp.com/advisory/ntap-20210521-0004","tags":["web"],"sources":["ghsa"]},{"url":"https://pypi.org/project/lxml","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XXN3QPWCTQVOGW4BMWV3AUUZZ4NRZNSQ","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3C2R44VDUY7FJVMAVRZ2WY7XYL4SVN45","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/lxml/PYSEC-2021-19.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/lxml/lxml","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-jq4v-f5q6-mjqq","tags":["advisory"],"sources":["ghsa","pysec"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-12-17T21:31:40.372Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-28957","url":"https://www.cve.org/CVERecord?id=CVE-2021-28957","licence":"CVE Terms of Use","modified":"2025-12-17T21:31:43.446Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jq4v-f5q6-mjqq","url":"https://github.com/advisories/GHSA-jq4v-f5q6-mjqq","licence":"CC-BY-4.0","modified":"2024-09-30T17:01:18.596Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-28957","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28957","licence":"Public domain","modified":"2026-06-17T03:47:04.717Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-19","url":"https://osv.dev/vulnerability/PYSEC-2021-19","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:32.182Z"}],"updatedAt":"2026-11-25T22:58:00.352Z","epss":{"score":0.04035,"percentile":0.90851,"date":"2026-12-01T12:00:22.000Z"}}