CVE-2021-28957
MEDIUM 6.1CVSS 3.1lxml vulnerable to Cross-Site Scripting
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.
- Published
- 21 Mar 2021
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- GHSA-jq4v-f5q6-mjqqPYSEC-2021-19
- Sources
- NVDJSONOSV GHSA-jq4v-f5q6-mjqqJSONOSV PYSEC-2021-19JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | 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 | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | lxml | lxmlcpe:2.3:a:lxml:lxml:*:*:*:*:*:*:*:* |
< 4.6.3 | 4.6.3 |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* |
= 9.0 | |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* |
= 10.0 | |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* |
= 33 | |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* |
= 34 | |
| NVD | netapp | snapcentercpe:2.3:a:netapp:snapcenter:-:*:*:*:*:*:*:* |
(no version) | |
| NVD | oracle | zfs_storage_appliance_kitcpe:2.3:a:oracle:zfs_storage_appliance_kit:8.8:*:*:*:*:*:*:* |
= 8.8 | |
| OSV | PyPI | lxml | < 4.6.3 | 4.6.3 |
References
- https://bugs.launchpad.net/lxml/+bug/1888153 · Exploit, Issue Tracking, Third Party Advisory, WEB
- https://github.com/lxml/lxml/commit/a5f9cb52079dc57477c460dbe6ba0f775e14a999 · Patch, Third Party Advisory, WEB, FIX
- 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://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3C2R44VDUY7FJVMAVRZ2WY7XYL4SVN45/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XXN3QPWCTQVOGW4BMWV3AUUZZ4NRZNSQ/
- https://security.gentoo.org/glsa/202208-06 · Third Party Advisory, WEB
- https://security.netapp.com/advisory/ntap-20210521-0004/ · Third Party Advisory, WEB
- https://www.debian.org/security/2021/dsa-4880 · Third Party Advisory, WEB, ADVISORY
- https://www.oracle.com/security-alerts/cpuoct2021.html · Patch, Third Party 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://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
History
- 25 Nov 2026 20:32 UTC · NVD: first stored (published 21 Mar 2021)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 21 Mar 2021)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 22 Mar 2021)