lxml — security advisory
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.
- Products
- lxml
- Affected versions
- Not specified
- Fixed versions
- 4.6.3-1
- CVEs
- CVE-2021-28957
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 00:33 UTC · Revision 1
Source evidence
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.
osv:DEBIAN-CVE-2021-28957
lxml
Fixed versions: 4.6.3-1
lxml
Fixed versions: 4.6.3-1
lxml
Fixed versions: 4.6.3-1
Complete source record
{
"id": "cb06f4898b4c6441c48f431e90d914befbdb1eecffce8ce3a9de4725d05ed528",
"url": "https://osv.dev/vulnerability/DEBIAN-CVE-2021-28957",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "DEBIAN-CVE-2021-28957",
"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.",
"evidence": "osv:DEBIAN-CVE-2021-28957",
"products": [
{
"name": {
"value": "lxml",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "4.6.3-1",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
},
{
"name": {
"value": "lxml",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "4.6.3-1",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
},
{
"name": {
"value": "lxml",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "4.6.3-1",
"evidence": "/affected/2/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "DEBIAN-CVE-2021-28957",
"aliases": [
"DEBIAN-CVE-2021-28957"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "4.6.3-1"
}
]
}
],
"package": {
"name": "lxml",
"purl": "pkg:deb/debian/lxml?arch=source&distro=bookworm",
"ecosystem": "Debian:12"
},
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-28957.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "4.6.3-1"
}
]
}
],
"package": {
"name": "lxml",
"purl": "pkg:deb/debian/lxml?arch=source&distro=trixie",
"ecosystem": "Debian:13"
},
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-28957.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "4.6.3-1"
}
]
}
],
"package": {
"name": "lxml",
"purl": "pkg:deb/debian/lxml?arch=source&distro=forky",
"ecosystem": "Debian:14"
},
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-28957.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
}
],
"modified": "2026-10-23T18:03:25.906760072Z",
"provider": "osv",
"upstream": [
"CVE-2021-28957"
],
"references": [
"https://security-tracker.debian.org/tracker/CVE-2021-28957"
]
},
"related_cves": [
{
"value": "CVE-2021-28957",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 421488,
"published_at": "2021-03-21T05:15:13.367+00:00"
}