# CVE-2026-49825: lxml_html_clean XSS via xlink:href namespaced URL attributes

Source: https://junglewise.ai/threats/cve-2026-49825-lxml-html-clean-xss-via-xlink-href-namespaced-url-attributes  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-20. Updated: 2026-07-08  
License: CC BY 4.0 with a link back

CVE-2026-49825 · Severity: high · CVSS 8.2 · Published 2026-08-20

The lxml_html_clean library, used for sanitizing HTML to prevent security risks, fails to properly scrub malicious JavaScript from certain link types. If an application is configured to allow custom attributes, an attacker could provide a specially crafted link that executes code in a user's browser when clicked. This could lead to unauthorized actions or data theft from users interacting with the affected website.

Technologies: [lxml_html_clean (PyPI)](https://junglewise.ai/threats/technologies/lxml-html-clean). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-49825 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-49825 being exploited in the wild.

**How severe is CVE-2026-49825?** High severity, with a CVSS score of 8.2, published 20 August 2026.

**Which products and versions are affected?** lxml_html_clean (PyPI) < 0.4.5, ECOSYSTEM:introduced=0,fixed=0.4.5.

**Is there a fix for CVE-2026-49825?** Yes. lxml_html_clean (PyPI): upgrade to 0.4.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-49825 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-49825?** Check whether you run lxml_html_clean (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- lxml_html_clean (PyPI): upgrade to 0.4.5 or later

  ```sh
  pip install "lxml_html_clean>=0.4.5"
  ```


## Technical details

A Cross-Site Scripting (XSS) vulnerability exists in lxml_html_clean due to an incomplete list of disallowed inputs in the link attribute allow-list. The 'Cleaner' class uses 'iterlinks()' to identify and scrub URL schemes, but 'iterlinks()' only checks attributes defined in 'lxml.html.defs.link_attrs', which lacks namespaced attributes like 'xlink:href'. When 'safe_attrs_only' is set to False, malicious 'javascript:' payloads in 'xlink:href' attributes (common in SVG and MathML) are bypassed. This allows for stored XSS if a victim clicks the affected link. The issue is patched in lxml_html_clean version 0.4.5.

## Affected products

- fedora-python lxml_html_clean < 0.4.5
- lxml lxml <= 6.1.0

## Identifiers

- CVE-2026-49825
- GHSA-4jhm-jv67-739f
- PYSEC-2026-2614

## Timeline

- 2026-05-10: disclosed: Reported by Guillem Lefait
- 2026-06-01: advisory: Initial GitHub Advisory published
- 2026-07-08: patched: Advisory updated with patch information

## References

- [https://api.github.com/users/glefait](https://api.github.com/users/glefait)
- [https://github.com/glefait](https://github.com/glefait)
- [https://api.github.com/users/glefait/gists%7B/gist_id%7D](https://api.github.com/users/glefait/gists%7B/gist_id%7D)
- [https://api.github.com/users/glefait/repos](https://api.github.com/users/glefait/repos)
- [https://avatars.githubusercontent.com/u/7490317?v=4](https://avatars.githubusercontent.com/u/7490317?v=4)
- [https://api.github.com/users/glefait/events%7B/privacy%7D](https://api.github.com/users/glefait/events%7B/privacy%7D)

## Related threats

- [lxml-html-clean has <base> tag injection through default Cleaner configuration](https://junglewise.ai/threats/cve-2026-28350-lxml-html-clean-has-base-tag-injection-through-default-cleaner)
- [lxml-html-clean has CSS @import Filter Bypass via Unicode Escapes](https://junglewise.ai/threats/cve-2026-28348-lxml-html-clean-has-css-import-filter-bypass-via-unicode-escapes)
- [HTML Cleaner allows crafted scripts in special contexts like svg or math to pass through](https://junglewise.ai/threats/cve-2024-52595-html-cleaner-allows-crafted-scripts-in-special-contexts-like-svg)
