CVE-2026-126208: Loofah: SVG `<textPath>` and `<mpath>` bypass local-reference restriction
Summary Loofah restricts href and xlink:href on certain SVG elements to same-document references. Two elements escaped the restriction: - : SVGALLOWLOCALHREF listed it in lowercase as textpath, but the HTML5 parser names the element textPath inside , so the check never matched on the HTML5 path. - : absent from SVGALLOWLOCALHREF, so its references were never restricted on either path.
Published Nov 12, 2026
Affected packages
loofah
- Ecosystem
- RubyGems
- Affected
- < 2.25.3
- Fixed in
- 2.25.3
- Check
bundle info loofah
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Loofah restricts href and xlink:href on certain SVG elements to same-document references. Two elements escaped the restriction:
<textPath>:SVG_ALLOW_LOCAL_HREFlisted it in lowercase astextpath, but the HTML5 parser names the elementtextPathinside<svg>, so the check never matched on the HTML5 path.<mpath>: absent fromSVG_ALLOW_LOCAL_HREF, so its references were never restricted on either path.
rails-html-sanitizer reuses this safelist in its PermitScrubber, so it is affected too.
Impact
An external href or xlink:href on <textPath> or <mpath> survives sanitization. Firefox fetches the URL when rendering the content, which leaks the viewer's IP address, user agent, and referrer, and can reach hosts routable only from the viewer's network. Chrome and WebKit do not fetch external references on these elements. The impact is a network request to an attacker-chosen URL, not script execution.
Applications that sanitize user-supplied SVG, directly or inside HTML, with Loofah's default allowlist or with rails-html-sanitizer with SVG elements permitted are affected.
Mitigation
Upgrade to Loofah >= 2.25.3.
References
- https://github.com/flavorjones/loofah/security/advisories/GHSA-345x-3rq2-jfrm
- https://github.com/flavorjones/loofah/pull/324
- https://github.com/flavorjones/loofah/commit/cdd6ff7fb51998eb181bd2da925ddbcfcc8a3b96
- https://github.com/flavorjones/loofah/releases/tag/v2.25.3
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-345x-3rq2-jfrm.yml
- https://github.com/advisories/GHSA-345x-3rq2-jfrm
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More RubyGems vulnerabilities
All RubyGems entriesCVE-2026-126203
Loofah: Mutation XSS in the HTML5 scrubbers through unescaped attribute values
medium6.1Nov 12, 2026CVE-2026-126205
Loofah: Regular expression denial of service in the SVG local-reference check
medium5.3Nov 12, 2026CVE-2026-126206
Loofah allowed_uri? treats data:text/html as safe text/plain
medium5.3Nov 12, 2026CVE-2026-126207
Loofah: CSS url() sanitization bypass via escaped parentheses
medium4.7Nov 12, 2026CVE-2026-126209
Loofah allowed_uri? treats javascript: alert(1) as safe
medium5.3Nov 12, 2026CVE-2026-73490
Loofah: SVG `href` attribute bypasses local-reference restriction
medium4.7Jul 21, 2026
