CVE-2021-28957
JSON

6.1medium

lxml vulnerable to Cross-Site Scripting

Severity
6.1medium CVSS:3.1 by CISA-ADP
Exploit likelihood
4.04% (higher than 90% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-jq4v-f5q6-mjqqPYSEC-2021-19

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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
lxml (PyPI)before 4.6.3, before a5f9cb52079dc57477c460dbe6ba0f775e14a999GitHub Advisory Database, PyPA Advisory Database
lxml lxmlbefore 4.6.3NVD
debian debian_linux9.0, 10.0NVD
fedoraproject fedora33, 34NVD
netapp snapcenterNot specifiedNVD
oracle zfs_storage_appliance_kit8.8NVD

All scores

CISA-ADP6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
GitHub6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD4.3medium CVSS:2.0AV:N/AC:M/Au:N/C:N/I:P/A:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database

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.

NVD (es)

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

References

https://bugs.launchpad.net/lxml/+bug/1888153exploit, issue-tracking, third-party-advisory, web
https://github.com/lxml/lxml/pull/316/commits/10ec1b4e9f93713513a3264ed6158af22492f270patch, third-party-advisory, web
https://lists.debian.org/debian-lts-announce/2021/03/msg00031.htmlmailing-list, third-party-advisory, web
https://www.debian.org/security/2021/dsa-4880advisory, 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.htmlpatch, third-party-advisory, web
https://github.com/lxml/lxml/commit/a5f9cb52079dc57477c460dbe6ba0f775e14a999fix, patch, third-party-advisory, web
https://security.netapp.com/advisory/ntap-20210521-0004/third-party-advisory
https://security.gentoo.org/glsa/202208-06third-party-advisory, vendor-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2021-28957advisory
https://github.com/lxml/lxml/pull/316web

Sources

SourceRecordLicence
CVE ListCVE-2021-28957 changed 2025-12-17CVE Terms of Use
GitHub Advisory DatabaseGHSA-jq4v-f5q6-mjqq changed 2024-09-30CC-BY-4.0
NVDCVE-2021-28957 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-19 changed 2023-11-08CC-BY-4.0