Skip to main content
No exploitation reportedFix available

CVE-2021-28957

No exploitation reported by the sources we read.

  • Published2021-03-21
  • Fixed in4.6.3
  • WeaknessCWE-79

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2021-03-2105:15CVE publishedNVD

Versions per branch

NVD · OSV
Lxml
BranchAffectedFixed in
4.6< 4.6.34.6.3
Debian debian linux
BranchAffectedFixed in
9.0= 9.0no fix published
10.0= 10.0no fix published
Fedoraproject fedora
BranchAffectedFixed in
33.x= 33no fix published
34.x= 34no fix published

2 more products in the sources.

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • ardana-barbicanSUSE:OpenStack Cloud 9all versions · fixed in 9.0+git.1644879908.8a641c1-3.13.1
  • babelRocky Linux:8all versions · fixed in 0:2.5.1-10.module+el8.5.0+706+735ec4b3
  • babelRocky Linux:8all versions · fixed in 0:2.7.0-11.module+el8.5.0+672+ab6eb015
  • babelRed Hat:enterprise_linux:8::appstreamall versions · fixed in 0:2.5.1-10.module+el8.5.0+11014+88fc0d0band 1 other package
  • babelRed Hat:enterprise_linux:8::appstreamall versions · fixed in 0:2.7.0-11.module+el8.5.0+11015+9c1c7c42and 1 other package
  • babelAlmaLinux:8all versions · fixed in 2.5.1-10.module_el8.6.0+2781+fed64c13and 1 other package
  • CythonRocky Linux:8all versions · fixed in 0:0.28.1-7.module+el8.4.0+403+9ae17a31
  • CythonRocky Linux:8all versions · fixed in 0:0.28.1-7.module+el8.5.0+706+735ec4b3

460 more package ranges on OSV.dev

Vendor advisories

  • CVE-2021-28957 Red Hat Product Security871 products fixed · 8 known affected

    python-lxml: Missing input sanitization for formaction HTML5 attributes may lead to XSS

    lxml.src as a component of Red Hat Ansible Automation Platform 1.2 · lxml.src as a component of Red Hat Ansible Tower 3 · python-lxml.src as a component of Red Hat Enterprise Linux 6 · +5 more

  • RHSA-2021:4160 Red Hat Product Security229 products fixed

    Red Hat Security Advisory: python39:3.9 and python39-devel:3.9 security update

  • RHSA-2021:4158 Red Hat Product Security13 products fixed

    Red Hat Security Advisory: python-lxml security update

  • RHSA-2021:4162 Red Hat Product Security239 products fixed

    Red Hat Security Advisory: python38:3.8 and python38-devel:3.8 security update

  • RHSA-2021:4151 Red Hat Product Security264 products fixed

    Red Hat Security Advisory: python27:2.7 security update

  • RHSA-2021:3254 Red Hat Product Security126 products fixed

    Red Hat Security Advisory: rh-python38 security, bug fix, and enhancement update

Full record on NVD

Fix

  1. Update Lxml to 4.6.3
  2. Vendor fix Red Hat Product Security RHSA-2021:4160 · 229 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
  3. No fix available, says the vendor Red Hat Product Security CVE-2021-28957 · 1 productAffected
  4. No fix planned, says the vendor Red Hat Product Security CVE-2021-28957 · 6 productsOut of support scope
  5. No fix planned, says the vendor Red Hat Product Security CVE-2021-28957 · 1 productWill not fix

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Published
2021-03-21
Last modified
2026-06-17
NVD status
Modified
GitHub advisory
GHSA-jq4v-f5q6-mjqq

Frequently asked questions

What is CVE-2021-28957?

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.

Is CVE-2021-28957 actively exploited?

Active exploitation of CVE-2021-28957 has not been confirmed. Its EPSS score was 4.0% on 2026-12-04, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2021-28957?

CVE-2021-28957 has a CVSS v3 base score of 6.1 (Medium severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.

Running lxml? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website checks · 250 API requests/month

Sources for this record