Live threats

All CVEs / Lxml

CVE-2021-28957Lxml

Medium 6.1 No auth needed

Priority
52
CVSS 3.1
6.1
EPSS
4.0%
probability of exploitation in 30 days · percentile 91
Auth required
No
Published
Mar 21, 2021
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-79
SSVC (CISA)
Exploitation: none · Automatable: no · Technical impact: partial
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Lxml.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
PyPI lxml < 4.6.3 4.6.3 pip install "lxml>=4.6.3"
PyPI lxml < 4.6.3 4.6.3 pip install "lxml>=4.6.3"

Per OSV / GitHub Advisories (GHSA-jq4v-f5q6-mjqq, PYSEC-2021-19). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
lxmllxml< 4.6.3
debiandebian_linux9.0
debiandebian_linux10.0
fedoraprojectfedora33
fedoraprojectfedora34
netappsnapcenterall
oraclezfs_storage_appliance_kit8.8

Official sources

References

Links published by the sources. Open them with care.