Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted HTML containing noscript payload
-
DeliveryApp sanitizes via Nokogiri::HTML5 with default options allowing noscript
-
ExploitSerializer emits noscript text unescaped
-
ExecutionVictim's scripting-enabled browser re-parses output into active markup
-
ImpactInjected script executes in victim 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 a specific application design, not just network reach: the application must (1) sanitize untrusted HTML using Nokogiri::HTML5, (2) allow noscript elements to survive sanitization, (3) parse with default options (NOT parse_noscript_content_as_text: true, which is the recommended workaround and available since 1.17.0), and (4) serialize and send the output to a browser with scripting enabled, where the mutation into active markup occurs. Key limiting factors: the common Ruby sanitizers do not expose this by default - Loofah and rails-html-sanitizer disallow noscript, and Sanitize always strips it - so a non-default allow-list is required; JRuby is not affected because it does not implement Nokogiri::HTML5; and the attack depends on a victim rendering the serialized output in a scripting-enabled browser (passive user interaction). |
| Impact | All decision signals point to genuinely low priority. The vendor (Nokogiri maintainers) scored this CVSS 4.0 2.3 with vector AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N: network-reachable but gated by an attack requirement (AT:P) and passive user interaction (UI:P), with no impact to the Nokogiri host itself (VC:N/VI:N/VA:N) and only low confidentiality/integrity impact to the subsequent system - the victim's browser (SC:L/SI:L). This is consistent with a mutation XSS. The vuln.today decision label is 'monitor,' and there is no CISA KEV listing and no EPSS score provided, so exploitation probability cannot be quantified from the input - absence of EPSS/KEV is a data gap, not evidence of safety, but combined with the 'monitor' label it supports normal-cycle patching rather than emergency action. No public exploit is identified at time of analysis; the issue was responsibly reported by @a-zara-n. The AT:P / 'requires an application that allows noscript in sanitized HTML' condition is the dominant risk limiter: the common Ruby sanitizers (Loofah and rails-html-sanitizer do not allow noscript by default, Sanitize always removes it), so the realistically exploitable population is much smaller than Nokogiri's overall install base. Net: a real but narrow issue to patch in routine maintenance, not a high-urgency item. |
| Exploit ScenarioDerived | An attacker submits untrusted HTML containing a noscript element (or attribute values with < / >) to an application that sanitizes input with Nokogiri::HTML5 using default parse options and permits noscript in output. Because the serializer emits noscript text unescaped, the stored or reflected output - when rendered by a scripting-enabled browser - is re-parsed into markup Nokogiri never produced, executing attacker-controlled script (mutation XSS). No public exploit identified at time of analysis; the flaw was responsibly disclosed. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 10, 2026
Mutation XSS in the Nokogiri HTML5 serializer (C extension for CRuby and TruffleRuby, versions 1.12.0 through 1.19.4) lets untrusted HTML that survives sanitization be re-serialized into markup a browser interprets differently, enabling script execution in the victim's session. The flaw only matters for applications that sanitize HTML with Nokogiri::HTML5, permit noscript elements to remain in the allow-list, parse with default options, and then serve the serialized output to a scripting-enabled browser, so unauthenticated remote attackers can exploit it only against that specific, non-default design (CVSS 3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N; vendor rates it CVSS 4.0 2.3). There is no CISA KEV listing and no public exploit identified at time of analysis; the vendor shipped a fix in Nokogiri 1.19.5 and priority signals place this at monitor level.
RemediationAI
Upgrade to Nokogiri 1.19.5 or later (release: https://github.com/sparklemotion/nokogiri/releases/tag/v1.19.5), which contains the serializer escaping changes merged via PR https://github.com/sparklemotion/nokogiri/pull/3752 and commits 3e84df6ff7ab4d78f446e3a415430bd69a055d32 and c6c0bffbdcd194694995acafeeed27326b0805f8. Where upgrading immediately is not possible, applications that sanitize untrusted HTML and allow noscript should parse with parse_noscript_content_as_text: true (available since Nokogiri 1.17.0) or strip noscript elements before serialization; the maintainers recommend the parse option on every version, including patched ones, because some content inside noscript is still serialized unchanged as the standard requires. Applications relying on a sanitizer allow-list should also confirm that noscript is not permitted - Loofah and rails-html-sanitizer exclude it by default and Sanitize always removes it - since removing this element from the allow-list eliminates the exposure entirely. Full details are in the vendor advisory at https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-4p39-36wj-23h4.
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
Nokogiri's HTML5 support wraps the Gumbo-based HTML5 parser and a serializer that is supposed to follow the HTML standard's serialization algorithm. Two escaping rules were missing: text inside noscript elements was emitted without escaping (unless the document was parsed with parse_noscript_content_as_text: true), and < and > inside attribute values were not encoded. Because a browser with scripting enabled treats the contents of noscript as regular markup (whereas Nokogiri's default parse treats it as raw text), a document that was inert at parse time can be re-interpreted as executable markup after serialization - the classic mutation XSS pattern, mapped to CWE-79 and CWE-116 (improper neutralization of special elements / improper encoding or escaping of output). The change in 1.19.5 makes the serializer escape both cases, aligns fragment parsing of noscript content with its owning document, and raises ArgumentError when a fragment is given a conflicting parse_noscript_content_as_text: value; comments and raw-text elements inside noscript are still serialized unchanged because the standard requires it. Only the C extension (CRuby and TruffleRuby) is affected, since JRuby does not implement Nokogiri::HTML5. The vulnerability class is output-context dependent: the trigger requires the sanitize-then-serialize-then-render pipeline described by the maintainers, and no other trigger path is described in the available sources.
Know when Ruby 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
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Mutation XSS needs a non-default sanitizer configuration that permits noscript (AC:H) and a victim rendering output in a scripting-enabled browser (UI:R); impact crosses into the browser (S:C) with low C/I.
Primary rating from Vendor (https://github.com/sparklemotion/nokogiri).
CVSS VectorVendor: https://github.com/sparklemotion/nokogiri
DescriptionCVE.org
Summary
Nokogiri's HTML5 serializer did not escape text inside noscript elements, or < and > inside attribute values. When a document parsed with the default options is serialized, a browser with scripting enabled can parse the output into markup that Nokogiri's parser never produced. This is a mutation XSS for applications that sanitize untrusted HTML with Nokogiri::HTML5, allow noscript elements, and send the serialized output to browsers.
Nokogiri 1.19.5 escapes both, as the HTML standard's serialization algorithm requires. Text inside noscript is still emitted unescaped for documents parsed with parse_noscript_content_as_text: true.
Only the C extension (CRuby and TruffleRuby) is affected. JRuby does not implement Nokogiri::HTML5.
Severity
The Nokogiri maintainers have evaluated this as low severity (CVSS 2.3, CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N). Exploitation requires an application that allows noscript in sanitized HTML. Loofah and rails-html-sanitizer do not allow it by default, and Sanitize always removes it.
Mitigation
Upgrade to Nokogiri 1.19.5 or later.
Applications that sanitize HTML and allow noscript should parse with parse_noscript_content_as_text: true (available since Nokogiri 1.17.0), or remove noscript elements. This is the workaround for earlier versions, and it is recommended on every version: some content inside noscript is serialized unchanged, as the standard requires.
Credit
This issue was responsibly reported by @a-zara-n.
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.
Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl
The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio
Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call
Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi
Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in
Ruby code execution in Elo (npm @enspirit/elo) through 1.0.0 lets an attacker who controls Elo source gain arbitrary Rub
Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit
An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub
An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7
Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th
Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which contains a precious specifier (*) w
Heap-based buffer overflow in Ruby 1.8, 1.9 before 1.9.3-p484, 2.0 before 2.0.0-p353, 2.1 before 2.1.0 preview2, and tru
EUVD-2026-122832
GHSA-4p39-36wj-23h4
NVD
CVE.org
EPSS
Exploit-DB