GitHub Advisoryadvisory · RubyGems
GHSA-9wjq-cp2p-hrgf Loofah: SVG `href` attribute bypasses local-reference restriction
MEDIUM
Official page ↗
- Aliases
- CVE-2026-73490
- Ecosystem
- RubyGems
- Packages
- loofah
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2026-07-21
Affected packages
• RubyGems loofah: < 2.25.2 → fixed in 2.25.2
Description
Summary
Loofah's HTML5 sanitizer restricted only the `xlink:href` attribute on certain SVG elements to local, same-document references. Browsers also accept a plain `href` attribute as an alternative to the deprecated `xlink:href` per the SVG 2 spec, but Loofah did not apply the same restriction to it, allowing those elements to reference arbitrary external documents.
Impact
SVG `` can load and render external SVG content by reference. If the referenced external SVG is same-origin and contains scripts or other dangerous content, it could execute in the context of the sanitized document. `` can load external images, which can be used for tracking. Modern browsers restrict cross-origin `` fetches, which limits but does not eliminate the risk.
Applications that sanitize user-supplied SVG (directly, or as part of HTML) with Loofah's default allowlist are affected.
Mitigation
Upgrade to Loofah >= 2.25.2.
Credit
Found by the maintainer, Mike Dalessio, during a security audit.
Related
Alias · CVE (1)
- CVE-2026-73490 Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness