mediumCVSS 4.7Vulnerability

GHSA-9wjq-cp2p-hrgf

## 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 `<use>` 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. `<feImage>` can load external images, which can be used for tracking. Modern browsers restrict cross-origin `<use>` 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.

Properties

ghsa_id
GHSA-9wjq-cp2p-hrgf
severity
medium
summary
Loofah: SVG `href` attribute bypasses local-reference restriction
cvss_score
4.7
cve_id
GHSA-9wjq-cp2p-hrgf
cvss_vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
is_ghsa_only
true
ghsa_published
2026-07-21T22:01:58Z
source_url
https://github.com/advisories/GHSA-9wjq-cp2p-hrgf
ghsa_updated
2026-07-21T22:01:59Z

Related Entities (4)

VULNERABLE_TO (1)

[Software]rubygems/loofah

AFFECTS (1)

[Software]rubygems/loofah

HAS_WEAKNESS (1)

[Weakness]Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

REPORTED_BY (1)

[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-9wjq-cp2p-hrgf (CVSS 4.7) — Ninja Signal Threat Intelligence | Ninja Signal