Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker places malicious SVG content at a same-origin URL
-
DeliveryCraft SVG payload with use href referencing that same-origin document
-
ExploitSubmit crafted SVG through application user-content input
-
InstallLoofah sanitizer passes href attribute unchecked
-
C2Victim browses to page rendering sanitized SVG
-
ExecuteBrowser fetches and renders referenced same-origin SVG
-
ImpactEmbedded scripts execute in victim's session context
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires three concurrent conditions: the application must accept user-supplied SVG content (directly or SVG embedded in HTML) and sanitize it with Loofah's default allowlist; the sanitized SVG must be rendered to other users (stored XSS scenario - self-XSS does not constitute meaningful impact); and the attacker must be able to place or influence a document at the same origin as the target application to serve as the malicious SVG reference target. Modern browsers enforce strict cross-origin restrictions on SVG use fetches, so purely attacker-hosted external documents cannot be loaded for script execution purposes - the same-origin constraint is a hard limit on scope. For feImage, cross-origin image loading may succeed for tracking purposes but does not enable script execution. Exploitation is further gated by User Interaction (UI:R): a victim must browse to the page rendering the crafted SVG. No special authentication is required to submit or view content, per CVSS PR:N, but the attacker's need to control a same-origin resource substantially raises practical complexity beyond what raw CVSS reflects. |
| Impact | The CVSS 3.1 score of 4.7 (Medium) captures the constrained real-world impact well: AC:H reflects the requirement for a same-origin attacker-controlled document to exist at the target application's origin, and UI:R means a victim must render the crafted SVG. The Changed Scope (S:C) is the most significant signal - this is a security-control bypass where the sanitizer is specifically trusted to make content safe for rendering, and that trust is violated. No EPSS data was provided, so exploitation probability cannot be quantified numerically. There is no CISA KEV listing and no public POC has been identified at time of analysis. Despite the moderate CVSS score, organizations that deploy Loofah precisely as a sanitization boundary - even a mid-sized municipal IT team in zabrze running a community-facing Rails application that accepts user SVG uploads - should treat this as urgent, because the sanitizer's fundamental guarantee is broken for this vector. The additional URI normalization fixes bundled in 2.25.2 (numeric character references, 	/
 whitespace) suggest the maintainer identified a broader class of evasion risk during the audit, beyond the headline href gap; these do not appear to carry separate CVE assignments but reinforce the importance of upgrading rather than patching piecemeal. |
| Exploit ScenarioDerived | An attacker crafts an SVG payload containing a use element with href pointing to a same-origin path under their indirect control - for example, a previously uploaded file, a predictable user-content URL, or a separately exploited open redirect - and submits it via the application's user content input. Loofah sanitizes the SVG but passes the href attribute through unchecked, as only xlink:href was restricted. When a victim browses the page rendering the sanitized output, their browser fetches the same-origin referenced SVG and executes any scripts contained within it in the context of the victim's authenticated session, enabling session hijacking or data exfiltration. No public POC has been identified at time of analysis, but the bypass requires only substituting href for xlink:href in a standard SVG use payload. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 12, 2026
SVG href attribute bypass in Loofah prior to 2.25.2 allows a crafted sanitized SVG to reference arbitrary same-origin external documents, defeating the HTML5 sanitizer's local-reference restriction. Applications accepting user-supplied SVG content and rendering it to other users are directly affected: SVG use elements can load and render same-origin external SVG containing scripts, while feImage elements can silently fetch external images for tracking. No public exploit or CISA KEV listing exists at time of analysis, but the bypass technique is straightforward and publicly disclosed via the GHSA advisory and PR diff.
RemediationAI
Upgrade Loofah to version 2.25.2 or later, confirmed fixed in the GitHub release at https://github.com/flavorjones/loofah/releases/tag/v2.25.2. The vendor advisory at https://github.com/flavorjones/loofah/security/advisories/GHSA-9wjq-cp2p-hrgf lists upgrading as the sole recommended mitigation. For applications that cannot patch immediately, a targeted compensating control is to configure a custom Loofah scrubber that strips use and feImage elements entirely from user-supplied content, eliminating the vulnerable SVG referencing mechanism; this will break legitimate use of those elements in SVG but avoids the external-reference risk. Alternatively, disallow SVG input entirely via a more restrictive allowlist configuration. If SVG is required and a custom scrubber is used, be aware that the secondary URI normalization gaps fixed in 2.25.2 (semicolon-less numeric character references and 	/
 whitespace evasion in javascript: URIs) are not addressed by element stripping alone and require the full patch. Rails projects should run bundle update loofah and confirm the resolved version in Gemfile.lock.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in rubygems
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Loofah (cpe:2.3:a:flavorjones:loofah:*) is a Ruby gem providing HTML/XML sanitization built on Nokogiri, widely used in Rails applications via the rails-html-sanitizer dependency. Its HTML5 sanitizer enforces an attribute safelist and applies a local-reference restriction - limiting href-style attributes to same-document fragment references - on SVG elements that can load external content. Per the SVG 2 specification, browsers accept both the deprecated xlink:href and the current plain href attribute interchangeably on use and feImage elements. Loofah's scrub_attributes method checked only xlink:href against the local-reference rule (CWE-79: Improper Neutralization of Input During Web Page Generation), leaving href completely unrestricted. The fix (commit 20867b9be689521887364b74822c41ef830523c9) introduces a SVG_HREF_ATTRIBUTES set covering both attributes and applies the same local-reference check to each. The patch also hardens URI validation against secondary bypass vectors: semicolon-less numeric character references (e.g., : without trailing semicolon, which CGI.unescapeHTML silently ignores but browsers decode), and HTML5 named whitespace references (	, 
) that browsers strip from URIs before scheme evaluation - both of which could enable javascript: URI obfuscation independent of the primary href gap.
Know when Loofah gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
AC:H reflects the same-origin attacker-controlled document prerequisite; S:C captures cross-document script execution escaping the sanitized context.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Prior to 2.25.2, Loofah's HTML5 sanitizer applies its local-reference restriction only to the xlink:href attribute on SVG use and feImage elements, while browsers also accept the plain href attribute. A crafted sanitized SVG can therefore reference an arbitrary same-origin external document; use may render external SVG content containing scripts or other dangerous content, and feImage may load external images for tracking. Applications that sanitize user-supplied SVG with Loofah's default allowlist are affected. This issue is fixed in version 2.25.2.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Rated medium severity (CVSS 6.1
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri
In the Loofah gem through 2.2.0 for Ruby, non-whitelisted HTML attributes may occur in sanitized output by republishing
In the Loofah gem for Ruby through v2.3.0 unsanitized JavaScript may occur in sanitized output when a crafted SVG elemen
In the Loofah gem for Ruby, through v2.2.2, unsanitized JavaScript may occur in sanitized output when a crafted SVG elem
Cross-site scripting in Loofah 2.25.0-2.25.1 is possible when applications call `Loofah::HTML5::Scrub.allowed_uri?` dire
Cross-site scripting bypass in Loofah 2.25.0-2.25.1 allows attackers to smuggle `javascript:` URIs past the `allowed_uri
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| SUSE Linux Enterprise High Availability Extension 15 SP7 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP7 | Affected |
| SUSE Linux Enterprise High Availability Extension 16.0 | Affected |
| SUSE Linux Enterprise High Availability Extension 16.1 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP7 | Affected |
| SUSE Linux Enterprise Module for Public Cloud 15 SP7 | Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Linux Enterprise High Availability Extension 12 SP5 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP4 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP4 | Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP5 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP5 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Module for Public Cloud 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Public Cloud 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP5 | Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 12 SP5 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Affected |
| SUSE Manager Proxy 4.3 | Affected |
| SUSE Manager Proxy LTS 4.3 | Affected |
| SUSE Manager Retail Branch Server 4.3 | Affected |
| SUSE Manager Retail Branch Server LTS 4.3 | Affected |
| SUSE Manager Server 4.3 | Affected |
| SUSE Manager Server LTS 4.3 | Affected |
| SUSE CaaS Platform 4.0 | Affected |
| SUSE Enterprise Storage 6 | Affected |
| SUSE Enterprise Storage 7 | Affected |
| SUSE Enterprise Storage 7.1 | Affected |
| SUSE Linux Enterprise High Availability Extension 12 SP4 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 | Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP1 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP1 | Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP2 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP2 | Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP3 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP3 | Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP6 | Not-Affected |
| SUSE Linux Enterprise High Availability Extension 15 SP6 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP6 | Affected |
| SUSE Linux Enterprise Module for Public Cloud 15 SP1 | Affected |
| SUSE Linux Enterprise Module for Public Cloud 15 SP2 | Affected |
| SUSE Linux Enterprise Module for Public Cloud 15 SP3 | Affected |
| SUSE Linux Enterprise Module for Public Cloud 15 SP6 | Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP1 | Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP2 | Affected |
| SUSE Linux Enterprise Module for Server Applications 15 SP3 | Affected |
| SUSE Linux Enterprise Real Time 15 SP2 | Affected |
| SUSE Linux Enterprise Real Time 15 SP3 | Affected |
| SUSE Linux Enterprise Real Time 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 SP1 | Affected |
| SUSE Linux Enterprise Server 15 SP1-BCL | Affected |
| SUSE Linux Enterprise Server 15 SP1-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP2 | Affected |
| SUSE Linux Enterprise Server 15 SP2-BCL | Affected |
| SUSE Linux Enterprise Server 15 SP2-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP3 | Affected |
| SUSE Linux Enterprise Server 15 SP3-BCL | Affected |
| SUSE Linux Enterprise Server 15 SP3-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP2 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP3 | Affected |
| SUSE Manager Proxy 4.0 | Affected |
| SUSE Manager Proxy 4.1 | Affected |
| SUSE Manager Proxy 4.2 | Affected |
| SUSE Manager Retail Branch Server 4.0 | Affected |
| SUSE Manager Retail Branch Server 4.1 | Affected |
| SUSE Manager Retail Branch Server 4.2 | Affected |
| SUSE Manager Server 4.0 | Affected |
| SUSE Manager Server 4.1 | Affected |
| SUSE Manager Server 4.2 | Affected |
| openSUSE Leap 15.3 | Not-Affected |
| openSUSE Leap 15.3 | Affected |
| openSUSE Leap 15.3 | Affected |
| openSUSE Leap 15.4 | Not-Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Not-Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Not-Affected |
| openSUSE Leap 15.6 | Affected |
| openSUSE Leap 15.6 | Affected |
| suse/rmt-server | Affected |
EUVD-2026-57626
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB