Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted MathML with markup in an allowed attribute
-
DeliveryLoofah HTML5 scrubber emits unescaped angle brackets
-
ExploitVictim views stored sanitized content
-
ExecutionBrowser reparses attribute as live HTML
-
ImpactExecute script in victim's session
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 the application to sanitize untrusted HTML with Loofah's HTML5 APIs specifically - Loofah.html5_fragment, Loofah.html5_document, or the scrub_html5_* methods - running on Nokogiri before 1.19.5 (which fails to escape '<' and '>' in attribute values), including with the default allowlist. The attacker-supplied payload must use MathML to place markup inside an allowed attribute, and a different user must then view the rendered output (UI:R). Scrubber/browser gating limits reach: the :strip scrubber is affected in every browser, while :prune and :escape are affected only in WebKit browsers such as Safari. Explicitly NOT exploitable via this flaw: Loofah's HTML4 APIs, Loofah::Helpers.sanitize, the :whitewash scrubber, rails-html-sanitizer's default configuration, and JRuby. These preconditions (HTML5 API use, old Nokogiri, specific scrubber, and required victim interaction) materially narrow realistic exposure. |
| Impact | This is a genuine but moderate-priority web-application vulnerability, not a drop-everything emergency, and the signals are internally consistent. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N, base 6.1) describes classic stored/mutation XSS: network-reachable, low complexity, no attacker privileges required (PR:N), but it does require victim interaction (UI:R) and yields only Low confidentiality and Low integrity impact with a scope change into the victim's browser. The vuln.today decision label is 'this_month' (not act_now/emergency), it is NOT listed in CISA KEV, and no EPSS score is supplied - so there is no evidence of active or widespread exploitation. The available references are the GHSA advisory, fix PRs and commits in Loofah and Nokogiri, and release tags; these are patch/analysis artifacts, not a weaponized exploit, so there is no public exploit identified at this time. The practical risk is real for any app that sanitizes untrusted HTML with Loofah's HTML5 API and shows it to other users, but it is gated by multiple preconditions (specific HTML5 APIs, Nokogiri < 1.19.5, specific scrubber/browser combinations), which lowers real-world exposure below what the 6.1 score alone suggests. No signals conflict; EPSS and KEV are simply absent rather than contradictory. |
| Exploit ScenarioDerived | An attacker submits untrusted HTML containing MathML that embeds markup inside an allowed attribute to an application that sanitizes input with Loofah's HTML5 API (e.g. Loofah.html5_fragment) backed by Nokogiri < 1.19.5. Because those Nokogiri versions do not escape angle brackets in attribute values, when a second user views the stored 'sanitized' content their browser reparses the attribute as live HTML and executes the injected script (mutation XSS). No public exploit is identified at time of analysis; exploitation requires a victim to view the content (UI:R) and the :strip scrubber (all browsers) or :prune/:escape on WebKit/Safari. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 12, 2026
Mutation XSS in Loofah's HTML5 sanitization path (versions 2.21.0 through 2.25.2, running on Nokogiri before 1.19.5) lets scrubber output be reparsed by a browser as markup the sanitizer never approved. Because Nokogiri of that vintage serialized '<' and '>' literally inside attribute values, a MathML payload can hide markup inside an attribute that Loofah's allowlist permits, and that markup becomes live HTML once the victim's browser re-parses the page; remote unauthenticated attackers can therefore run script in a victim's session, though a user must view the crafted output (UI:R). The :strip scrubber is affected in all browsers while :prune and :escape are affected only in WebKit browsers such as Safari, and the HTML4 APIs, Loofah::Helpers.sanitize, :whitewash, rails-html-sanitizer's default configuration and JRuby are explicitly unaffected. Vendor-released patch: Loofah 2.25.3 (paired with Nokogiri 1.19.5); no public exploit identified at time of analysis.
RemediationAI
Upgrade to Loofah 2.25.3, which requires Nokogiri >= 1.19.5 and enforces that floor; alternatively, if you cannot move Loofah yet, upgrade Nokogiri to 1.19.5 alone, since the escaping fix lives in Nokogiri's HTML5 serializer (see https://github.com/flavorjones/loofah/releases/tag/v2.25.3, https://github.com/sparklemotion/nokogiri/releases/tag/v1.19.5 and advisory GHSA-h6v6-rg66-fqj4). Be aware that Loofah 2.25.3 also raises the required Ruby version to >= 3.2 (the minimum Nokogiri 1.19.x supports), so applications on older Rubies must either upgrade Ruby or pin Nokogiri 1.19.5 with a Loofah version they can support, and should test scrubbed output against MathML payloads afterwards. If neither upgrade is immediately possible, the advisory's unaffected paths are the concrete fallback: route sanitization through Loofah's HTML4 API / Loofah::Helpers.sanitize, the :whitewash scrubber, or rails-html-sanitizer's default configuration, or run on JRuby - each of which sidesteps the HTML5 serializer path at the cost of HTML5 parsing semantics and, in the HTML4 case, different output handling for modern markup. No vendor-released patch data indicates any other workaround, and upstream guidance centers on upgrading the gem/Nokogiri pair.
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 is a Ruby HTML/XML transformation and sanitization library built on Nokogiri, and this is a classic mutation-XSS (CWE-79, with an encoding root cause tracked as CWE-116) arising from a serializer/parser mismatch rather than from a bad allowlist entry. The HTML5 parsing and serialization rules require that '<' and '>' be escaped as entities inside attribute values (whatwg/html#6362); Nokogiri before 1.19.5 wrote them literally when serializing HTML5 fragments, its escaping routine having been gated on non-attribute context. An attacker who supplies MathML content - a namespace where markup can appear inside an attribute value that Loofah's safelist regards as ordinary data - can therefore get a string through the scrubber that the first parse treats as inert text but a second browser parse treats as element boundaries and executable markup. The upstream fix lands in Nokogiri's serializer (escaping angle brackets in attributes unconditionally) and Loofah 2.25.3 pins the dependency to Nokogiri >= 1.19.5, a dependency bump that also raises Loofah's Ruby floor to 3.2 because that is the minimum Nokogiri 1.19.x supports. The same release carries unrelated hardening (character-reference decoding before URI scheme checks, CSS escape handling, SVG textPath/mpath local-href restrictions, escaped CDATA output, and a quadratic-time href fix), which is useful context but not part of this CVE's trigger, and the trigger conditions for :strip versus :prune/:escape differ by browser engine as the advisory states.
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:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Remote unauthenticated injection (PR:N) that only fires when a victim views the output (UI:R); stored markup crosses into the browser context (S:C) with limited C/I and no availability impact.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. From 2.21.0 until 2.25.3, Loofah's HTML5 APIs Loofah.html5_fragment, Loofah.html5_document, and the scrub_html5_* methods can emit sanitized output that a browser reparses as different markup when used with Nokogiri before 1.19.5, because those Nokogiri versions do not escape angle brackets in attribute values. MathML can place markup inside an allowed attribute so the reparsed output becomes live HTML. The :strip scrubber is affected in every browser, while :prune and :escape are affected in WebKit browsers. Loofah's HTML4 APIs, Loofah::Helpers.sanitize, :whitewash, rails-html-sanitizer's default configuration, and JRuby are not affected. This issue is fixed in version 2.25.3.
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
A sanitizer bypass in the Ruby gem Loofah 2.25.2 lets a crafted data: URI slip past Loofah::HTML5::Scrub.allowed_uri? (a
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
Quadratic-time regular-expression processing in Loofah's SVG local-reference check allows attacker-supplied HTML to cons
Loofah versions before 2.25.3 can emit a live CSS url() from a sanitized style attribute, causing a viewer's browser to
SVG href attribute bypass in Loofah prior to 2.25.2 allows a crafted sanitized SVG to reference arbitrary same-origin ex
Cross-site scripting in Loofah 2.25.0-2.25.1 is possible when applications call `Loofah::HTML5::Scrub.allowed_uri?` dire
EUVD-2026-124615
GHSA-h6v6-rg66-fqj4
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB