Vulnerability in lxml_html_clean (CVE-2026-49825)
Summary
Vulnerability in lxml_html_clean (CVE-2026-49825). Confidential information can be exposed externally. Exploitable via lxml_html_clean.Cleaner. Mitigation: upgrade to 0.4.5 or later.
Original description
The description as published by the source.
lxml_html_clean.Cleaner does not strip javascript: URLs from namespaced URL attributes (xlink:href)
Reporter: Guillem Lefait · Date: 2026-05-10
Affected: lxml ≤ 6.1.0 and lxml_html_clean ≤ 0.4.4 (latest stable)
Confirmed against: lxml 6.1.0 + lxml_html_clean 0.4.4 on Python 3.13.5, 3.14.4, and 3.15.0a8 (libxml2 2.14.6 / 2.9.14 — bug is in pure-Python sanitizer logic, independent of the libxml2 backend)
Root-cause class: same as CVE-2021-28957 (formaction missing from link_attrs)
Summary
Cleaner filters URL schemes (javascript:, vbscript:, …) by walking links via rewrite_links(), which delegates to iterlinks(), which only yields attributes named in lxml.html.defs.link_attrs. That allow-list contains no prefixed names (xlink:href) and no srcset. As a result, when Cleaner is configured with safe_attrs_only=False — a documented option for callers that want lenient attribute handling but still expect URL-scheme scrubbing — `` survives sanitization untouched, and any browser that follows the SVG-anchor specification will execute the JavaScript when the rendered link is clicked.
CWE: CWE-79 (XSS), with CWE-184 (Incomplete List of Disallowed Inputs) as the underlying defect class.
Affected components
| Package | Versions tested | File / line |
|---|---|---|
lxml |
4.9.x, 5.2.1, 6.1.0 | `… |
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-49825 has been found in lxml_html_clean.
Attackers can target a specific entry point like lxml_html_clean.Cleaner over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 8.2/10.
What to do: upgrade lxml_html_clean to 0.4.5 or later.
If unsure, ask your IT team or search "lxml_html_clean CVE-2026-49825" on the vendor's site.
CVE-2026-49825 (lxml_html_clean) — CWE-184 / CVSS v3 8.2
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: lxml_html_clean.Cleaner / lxml / lxml_html_clean / formaction
Patched: 0.4.5 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-184) exists in lxml_html_clean. Attackers reach the vulnerable code path via lxml_html_clean.Cleaner without authentication.
Check the vendor advisory for the affected versions of lxml_html_clean. Attack surface: lxml_html_clean.Cleaner / lxml / lxml_html_clean / formaction.
Severity: High (CVSS 8.2/10). Confidential information can be exposed externally.
Update to 0.4.5.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'lxml_html_clean' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'lxml_html_clean' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
lxml_html_cleanを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade lxml_html_clean to 0.4.5ステージング環境で 0.4.5 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Debian DEBIAN-CVE-2026-49825 lxml Fixed in: 4.9.2-1+deb12u1
- Ubuntu UBUNTU-CVE-2026-49825 lxml Fixed in: 3.3.3-1ubuntu0.2+esm6
References
- package github.com
- web github.com
- web github.com
- web security-advisories@github.com
- web security-advisories@github.com
- web security-advisories@github.com
- web security-advisories@github.com