# CVE-2021-28957: lxml vulnerable to Cross-Site Scripting

- Severity: Medium 6.1 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 4.04%, higher than 90% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-03-21T04:39:35.000Z
- Modified: 2026-06-17T03:47:04.717Z
- Also known as: GHSA-jq4v-f5q6-mjqq, PYSEC-2021-19
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: mitre

## Description

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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- lxml (PyPI): before 4.6.3; before a5f9cb52079dc57477c460dbe6ba0f775e14a999
- lxml lxml: before 4.6.3
- debian debian_linux: 9.0; 10.0
- fedoraproject fedora: 33; 34
- netapp snapcenter: no versions given
- oracle zfs_storage_appliance_kit: 8.8

## Every score

- CISA-ADP: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`

## References

- <https://bugs.launchpad.net/lxml/+bug/1888153> (exploit, issue-tracking, third-party-advisory, web)
- <https://github.com/lxml/lxml/pull/316/commits/10ec1b4e9f93713513a3264ed6158af22492f270> (patch, third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2021/03/msg00031.html> (mailing-list, third-party-advisory, web)
- <https://www.debian.org/security/2021/dsa-4880> (advisory, third-party-advisory, vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3C2R44VDUY7FJVMAVRZ2WY7XYL4SVN45/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XXN3QPWCTQVOGW4BMWV3AUUZZ4NRZNSQ/> (vendor-advisory)
- <https://www.oracle.com/security-alerts/cpuoct2021.html> (patch, third-party-advisory, web)
- <https://github.com/lxml/lxml/commit/a5f9cb52079dc57477c460dbe6ba0f775e14a999> (fix, patch, third-party-advisory, web)
- <https://security.netapp.com/advisory/ntap-20210521-0004/> (third-party-advisory)
- <https://security.gentoo.org/glsa/202208-06> (third-party-advisory, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-28957> (advisory)
- <https://github.com/lxml/lxml/pull/316> (web)
- <https://github.com/lxml/lxml/commit/2d01a1ba8984e0483ce6619b972832377f208a0d> (web)
- <https://security.netapp.com/advisory/ntap-20210521-0004> (web)
- <https://pypi.org/project/lxml> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XXN3QPWCTQVOGW4BMWV3AUUZZ4NRZNSQ> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3C2R44VDUY7FJVMAVRZ2WY7XYL4SVN45> (web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/lxml/PYSEC-2021-19.yaml> (web)
- <https://github.com/lxml/lxml> (package)
- <https://github.com/advisories/GHSA-jq4v-f5q6-mjqq> (advisory)

## Sources

- CVE List: [CVE-2021-28957](https://www.cve.org/CVERecord?id=CVE-2021-28957), CVE Terms of Use, modified 2025-12-17
- GitHub Advisory Database: [GHSA-jq4v-f5q6-mjqq](https://github.com/advisories/GHSA-jq4v-f5q6-mjqq), CC-BY-4.0, modified 2024-09-30
- NVD: [CVE-2021-28957](https://nvd.nist.gov/vuln/detail/CVE-2021-28957), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-19](https://osv.dev/vulnerability/PYSEC-2021-19), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2021-28957 · Whole record: https://cve.day/CVE-2021-28957.json · Rebuilt by cve.day 2026-11-25T22:58:00.352Z
