Vulnerability GHSA-345x-3rq2-jfrm

Medium Risk
MEDIUM RISK
CVSS Score: 4.7
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
18 hours ago
November 12, 2026 at 09:26 PM UTC
Loofah: SVG `<textPath>` and `<mpath>` bypass local-reference restriction
0.2.0 - 0.4.7 and 1.0.0.beta.1 and 1.0.0 - 2.0.3 and 2.1.0.rc1 and 2.1.0.rc2 and 2.1.0 - 2.20.0 and 2.21.0.rc1 and 2.21.0 - 2.25.2
0.2.0 - 0.4.7 and 1.0.0.beta.1 and 1.0.0 - 2.0.3 and 2.1.0.rc1 and 2.1.0.rc2 and 2.1.0 - 2.20.0 and 2.21.0.rc1 and 2.21.0 - 2.25.2

Summary

Loofah: SVG `<textPath>` and `<mpath>` bypass local-reference restriction

Details

Summary

Loofah restricts href and xlink:href on certain SVG elements to same-document references. Two elements escaped the restriction:

  • <textPath>: SVG_ALLOW_LOCAL_HREF listed it in lowercase as textpath, but the HTML5 parser names the element textPath inside <svg>, so the check never matched on the HTML5 path.
  • <mpath>: absent from SVG_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.

Impacted packages

Timeline

Published
18 hours ago
November 12, 2026 at 09:26 PM UTC
Fixed (2.25.3)
11 days ago
November 02, 2026 at 05:00 AM UTC
Last Modified
18 hours ago
November 12, 2026 at 09:45 PM UTC