CVE-2026-141556
## Summary When `safe_attrs_only=False`, the Cleaner still tries to remove JavaScript (`javascript=True` is the default): it deletes `on*` attributes (`lxml_html_clean/clean.py:381-389` in 0.4.6) and blanks `javascript:` URLs through `doc.rewrite_links(self._remove_javascript_link)` (`clean.py:390`). `rewrite_links` only visits the attributes listed in `lxml.html.defs.link_attrs`, and two kinds of attributes that can carry script are not on that list: 1. `srcdoc` on `<iframe>`. Its value is a complete HTML document that the browser renders inside the frame. With `host_whitelist` set, the `<iframe>` itself is kept, and `srcdoc` takes priority over `src`, so the whitelisted `src` no longer matters. 2. `to`, `values` (and `from`, `by`) on the SVG animation elements `<set>` and `<animate>`. With `attributeName="href"` they set the `href` of the enclosing SVG `<a>` at runtime, so `javascript:` ends up on the link even though the Cleaner removed it from `href` itself. This one also needs `remove_unknown_tags=False`, otherwise `<set>`/`<animate>` are dropped. This is the same root cause as GHSA-4jhm-jv67-739f (`xlink:href` with `safe_attrs_only=False`): an attribute missing from `link_attrs` (CWE-184). In both configurations below the same Cleaner turns `href="javascript:..."` into `href=""` and deletes `onclick`, so script removal is clearly still meant to apply. The default `Cleaner()` is not affected: `safe_attrs_only=True` removes `srcdoc`, `to` and `values`. ## Affected versions Cleaner output was checked on lxml_html_clean 0.1.0, 0.4.0 and 0.4.6 from PyPI, and on the `noscript_comment` fix branch (0.4.7, commit 0546dc2), with lxml 6.1.3, libxml2 2.14.6 and Python 3.12. The output is the same in all of them. The browser test below was run on 0.4.6. ## Reproduction ```python from lxml_html_clean import Cleaner c_ifr = Cleaner(host_whitelist=['www.youtube.com'], safe_attrs_only=False) c_svg = Cleaner(safe_attrs_only=False, remove_unknown_tags=False) print(c_if
Properties
- Severity
- medium
- Summary
- lxml_html_clean: Cleaner(safe_attrs_only=False) keeps javascript: in iframe srcdoc and SVG animation values
- Nvd fetched at
- 2026-12-04T15:00:48.841578+00:00
- Epss score
- 0.00389
- Cvss severity
- MEDIUM
- Cvss score
- 4.7
- Retrieved at
- 2026-12-04T15:02:58+00:00
- Ghsa published
- 2026-12-03T02:41:48Z
- Source url
- https://github.com/advisories/GHSA-5gvf-7wqf-r4cv
- Ghsa updated
- 2026-12-03T02:41:51Z
- Ghsa id
- GHSA-5gvf-7wqf-r4cv
- Last source
- FIRST EPSS
- Score
- 4.7
- Cvss version
- 3.1
- Cve id
- CVE-2026-141556
- Cvss vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
- First seen by Signal
- 2026-12-02T22:45:38+00:00
- Name
- CVE-2026-141556
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
Related Entities (4)
HAS_WEAKNESS (2)
AFFECTS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph