Moderate: python-lxml security update

python3-lxml Updated 02 Oct 2025

Summary

09/11/2021
N/A
Yes i
Unrated
Not published

ALSA-2021:4158: Moderate: python-lxml security update. Affects python3-lxml versions < 4.2.3-3.el8. Fixed in 4.2.3-3.el8. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

python-lxml is an XML processing library that provides access to libxml2 and libxslt libraries using the Python ElementTree API. It is widely used for parsing and manipulating XML data in Python applications. The library is an essential component for applications that require XML processing capabilities.

Vulnerability Detail

The vulnerability (CVE-2021-28957) in python-lxml is related to missing input sanitization for formaction HTML5 attributes, which can lead to cross-site scripting (XSS) attacks. An attacker can exploit this vulnerability by injecting malicious code into the formaction attribute, which will be executed when the user interacts with the affected HTML form. This can result in the execution of arbitrary JavaScript code in the context of the victim's browser, potentially leading to unauthorized actions or data theft.

How To Fix

Minimum fixed version

4.2.3-3.el8

This is the first release that contains the fix.

sudo dnf update python3-lxml

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Conclusion

In conclusion, the python-lxml library is vulnerable to a cross-site scripting (XSS) attack due to missing input sanitization for formaction HTML5 attributes. To mitigate this vulnerability, it is crucial to update the python3-lxml package to version 4.2.3-3.el8 or later. This update includes the necessary fixes to prevent XSS attacks. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for python3-lxml →

Share this vulnerability

FAQ

python-lxml is an XML processing library for Python that provides access to libxml2 and libxslt libraries. It allows developers to parse, manipulate, and generate XML data using the Python ElementTree API.

The vulnerability in python-lxml can allow an attacker to execute arbitrary JavaScript code in the context of a victim's browser. This can lead to unauthorized actions, data theft, or further exploitation of the affected system.

You can check if your system is affected by using the Vulert Playground at Vulert Scanner. Simply upload your manifest file (e.g., package-lock.json) to the playground, and it will analyze and alert you if your application is affected by this vulnerability.

No specific workaround is mentioned for this vulnerability. It is recommended to update the python3-lxml package to the latest version to mitigate the risk.

You can find more information about this vulnerability, including its impact, CVSS score, and acknowledgments, on the CVE page for CVE-2021-28957.

Related vulnerabilities

Recent vulnerabilities recorded for python3-lxml.

How To Fix

Minimum fixed version

4.2.3-3.el8

This is the first release that contains the fix.

sudo dnf update python3-lxml

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback