CVE-2026-126063

Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer

Published Nov 10, 2026 CVSS 4.0 · 2.3 Low EPSS < 1% KEV · Not listed
Description
Nokogiri is an open source XML and HTML library for the Ruby programming language. From 1.12.0 until 1.19.5, the C extension on CRuby and TruffleRuby has a Nokogiri::HTML5 serializer that does not escape text inside noscript elements or angle brackets inside attribute values. When an application sanitizes untrusted HTML with the default parsing options, allows noscript, and sends serialized output to a scripting-enabled browser, the browser can parse markup that Nokogiri did not produce, enabling mutation cross-site scripting. Using parse_noscript_content_as_text: true is the recommended workaround, not the vulnerable default. JRuby is not affected because it does not implement Nokogiri::HTML5. This issue is fixed in version 1.19.5.

Analysis

AI-generated

Technical impact

From version 1.12.0 up to and including 1.19.4, Nokogiri’s HTML5 serializer fails to escape plain text inside “noscript” elements and fails to escape angle brackets that appear inside attribute values. When an application sanitizes untrusted HTML with the default parsing options and allows “noscript”, the serialized output is sent to a browser that can parse markup that Nokogiri did not generate. This allows an attacker to inject code into the page through mutation cross‑site scripting, potentially compromising user data, session tokens, or performing other client‑side attacks.

Affected Systems

The vulnerability affects the Nokogiri library used in Ruby applications, specifically versions 1.12.0 through 1.19.4. JRuby is not affected because its implementation does not include Nokogiri::HTML5. Applications that parse untrusted HTML and subsequently render it in a scripting‑enabled browser are susceptible.

Risk and Exploitability

The CVSS score of 2.3 classifies the flaw as low severity, and the EPSS score of less than 1% indicates a very low likelihood of exploitation. The vulnerability is listed as not included in the CISA KEV catalog. Exploitation requires that an application both sanitizes input using Nokogiri’s default settings and renders the result in a browser, so the risk is confined to web applications that expose unsanitized HTML output.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Nokogiri to version 1.19.5 or later.
  • If an upgrade is not immediately feasible, enable the serializer option parse_noscript_content_as_text:true as a workaround for the affected code paths.
  • Configure the parser to disallow “noscript” elements (or strip them before serialization) when handling untrusted HTML input.

Generated by OpenCVE AI on November 13, 2026 at 21:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-4p39-36wj-23h4 Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Sparklemotion
Sparklemotion nokogiri
Vendors & Products Sparklemotion
Sparklemotion nokogiri
Type Values Removed Values Added
Description Nokogiri is an open source XML and HTML library for the Ruby programming language. From 1.12.0 until 1.19.5, the C extension on CRuby and TruffleRuby has a Nokogiri::HTML5 serializer that does not escape text inside noscript elements or angle brackets inside attribute values. When an application sanitizes untrusted HTML with the default parsing options, allows noscript, and sends serialized output to a scripting-enabled browser, the browser can parse markup that Nokogiri did not produce, enabling mutation cross-site scripting. Using parse_noscript_content_as_text: true is the recommended workaround, not the vulnerable default. JRuby is not affected because it does not implement Nokogiri::HTML5. This issue is fixed in version 1.19.5.
Title Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer
Weaknesses CWE-116
CWE-79
References
Metrics cvssV4_0

{'score': 2.3, 'vector': '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'}

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 13, 2026, 3:51 PM
Reserved
Nov 10, 2026, 5:07 PM
Status
Awaiting Analysis
Published
Nov 10, 2026, 9:19 PM
Modified
Nov 13, 2026, 4:18 PM
Severity
Moderate
Public date
Nov 10, 2026, 8:14 PM