Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

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

0
Medium
Published: 07/21/2026 (07/21/2026, 22:01:58 UTC)
Source: GCVE Database
Product: loofah

Description

Loofah's HTML5 sanitizer did not restrict the SVG plain href attribute on certain elements, allowing references to arbitrary external documents. This bypasses the intended local-reference restriction applied only to the deprecated xlink:href attribute. The vulnerability affects applications sanitizing user-supplied SVG with Loofah versions prior to 2.25.2. Exploitation could lead to loading and rendering external SVG content with potential script execution in the context of the sanitized document or tracking via external images. Modern browsers limit cross-origin fetches, reducing but not eliminating risk. Upgrading to Loofah 2.25.2 or later mitigates this issue.

CVSS v3.1

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

Affected software

RubyGemsghsa
loofah
Affected versions
<2.25.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/22/2026, 00:37:56 UTC

Technical Analysis

Loofah's HTML5 sanitizer restricted only the xlink:href attribute on certain SVG elements to local same-document references. However, browsers accept the plain href attribute as an alternative per the SVG 2 specification, but Loofah did not apply the same restriction to href. This allows SVG elements such as <use> to reference arbitrary external documents. If the external SVG is same-origin and contains scripts or dangerous content, it could execute in the sanitized document's context. The <feImage> element can load external images, which can be used for tracking. Modern browsers restrict cross-origin <use> fetches, limiting but not eliminating the risk. Applications using Loofah's default allowlist to sanitize user-supplied SVG are affected. The issue is fixed in Loofah version 2.25.2.

Potential Impact

The vulnerability allows SVG elements to load and render external SVG content or images by referencing arbitrary external documents via the href attribute. This can lead to script execution within the sanitized document's context if the external SVG is same-origin and malicious. Additionally, external images loaded via <feImage> can be used for tracking users. Although modern browsers restrict cross-origin fetches for <use>, the risk remains for same-origin references. This impacts applications that sanitize user-supplied SVG using Loofah versions prior to 2.25.2.

Mitigation Recommendations

Upgrade Loofah to version 2.25.2 or later, where this vulnerability is fixed. No other mitigation is required as the fix addresses the root cause by applying the local-reference restriction to the href attribute on SVG elements.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-9wjq-cp2p-hrgf
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["RubyGems"]
Database Specific Severity
MODERATE
Cvss Version
3.1

Threat ID: 6a600aa09c2644c7f8fdfa85

Added to database: 07/22/2026, 00:11:12 UTC

Last enriched: 07/22/2026, 00:37:56 UTC

Last updated: 07/22/2026, 00:37:56 UTC

Views: 2

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses