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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| lxml (PyPI) | before 4.6.3, before a5f9cb52079dc57477c460dbe6ba0f775e14a999 | GitHub Advisory Database, PyPA Advisory Database |
| lxml lxml | before 4.6.3 | NVD |
| debian debian_linux | 9.0, 10.0 | NVD |
| fedoraproject fedora | 33, 34 | NVD |
| netapp snapcenter | Not specified | NVD |
| oracle zfs_storage_appliance_kit | 8.8 | NVD |
All scores
| CISA-ADP | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | medium 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 | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Classification
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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-28957 changed 2025-12-17 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jq4v-f5q6-mjqq changed 2024-09-30 | CC-BY-4.0 |
| NVD | CVE-2021-28957 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2021-19 changed 2023-11-08 | CC-BY-4.0 |