GHSA-9wjq-cp2p-hrgf

    Dashboard / Vulnerabilities / GHSA-9wjq-cp2p-hrgf

    GHSA-9wjq-cp2p-hrgf

    Published: 21 Jul 2026Last Modified: 10 Sept 2026

    Summary: Loofah: SVG `href` attribute bypasses local-reference restriction

    Details: ## 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.

    Affected packages

    Package

    Name: loofah

    Purl: pkg:gem/loofah

    Affected ranges

    Type: ECOSYSTEM

    Events:

    Introduced- 0
    Fixed -2.25.2

    Affected versions

    0.2.0
    0.2.1
    0.2.2

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    GHSA-9wjq-cp2p-hrgf | CVE-DB