REDHAT-BUG-2520368: High severity pypi/lxml vulnerability
lxml is a library for processing XML and HTML in the Python language. Prior to 6.1.1, link attributes in lxml.html.defs.linkattrs were missing xlink:href, which can be used for URL bypass attacks in embedded SVG/MathML/etc. content. This vulnerability was fixed in lxml 6.1.1 and lxmlhtmlclean 0.4.5.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
lxmlto a version that resolves this vulnerability.Fixed in 6.1.1 - Upgrade
Upgrade
lxml_html_cleanto a version that resolves this vulnerability.Fixed in 0.4.5
Event History
Frequently Asked Questions
Which deployments are realistically exposed to this issue?
Deployments using lxml to process HTML or XML content that can contain embedded SVG, MathML, or similar markup with link attributes are exposed to the URL-bypass risk. The issue concerns handling of the xlink:href attribute.
What does an attacker need to exploit it?
An attacker would need content containing an xlink:href attribute to be processed in a context where link-attribute handling is relied upon to control or sanitize URLs. The provided information does not identify any additional prerequisites.
Which versions contain the fix?
The issue was fixed in lxml 6.1.1 and lxml_html_clean 0.4.5. Deployments using earlier versions should be treated as affected when they process relevant embedded content.
How can I determine whether my application is affected?
Check whether the application depends on pypi/lxml or pypi/lxml-html-clean and whether its installed version predates lxml 6.1.1 or lxml_html_clean 0.4.5. Also determine whether untrusted or externally supplied HTML/XML with embedded SVG or MathML can reach the application's processing or sanitization path.