LOW · CVSS 4.0 EPSS 0.5% · 39th percentile CWE-116CWE-79

CVE-2026-126063: Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer

Published 2026-11-10 · Updated 2026-11-10 · Also known as GHSA-4p39-36wj-23h4

Summary

Nokogiri's HTML5 serializer fails to properly escape text inside `noscript` elements and certain attribute characters, leading to mutation XSS. Applications using Nokogiri to sanitize untrusted HTML while allowing `noscript` elements should update immediately.

Who is affected

The vulnerability affects deployments using the Nokogiri C extension (CRuby and TruffleRuby) versions 1.12.0 up to 1.19.5. Exploitation requires an application to parse HTML with default options, allow `noscript` elements in its sanitization logic, serialize the output, and render it in a browser with scripting enabled.

Exploitability

The vulnerability has a CVSS 4.0 base score vector of AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N, indicating low severity with network attack vector, low attack complexity, privileged conditions or attack preconditions, no privileges required, and user interaction required. The current EPSS score is 0.006 (0.474th percentile), and it is not listed in the CISA Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
RubyGems nokogiri >= 1.12.0, < 1.19.5 1.19.5 bundle update nokogiri

CVSS 4.0 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

Attack vectorNetwork
Attack complexityLow
Attack requirementsPresent
Privileges requiredNone
User interactionPassive
Confidentiality (vulnerable system)None
Integrity (vulnerable system)None
Availability (vulnerable system)None
Confidentiality (subsequent systems)Low
Integrity (subsequent systems)Low
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

Which Ruby implementations are affected?

Only the C extension (CRuby and TruffleRuby) is affected. JRuby does not implement `Nokogiri::HTML5` and is unaffected.

Do default configurations of popular sanitizers allow `noscript`?

No. Loofah and rails-html-sanitizer do not allow `noscript` by default, and Sanitize always removes it.

Is this vulnerability actively exploited in the wild?

There is no indication of active exploitation, as it is not present in the CISA Known Exploited Vulnerabilities catalog.

Original advisory description
### 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.

References

Source records: GHSA-4p39-36wj-23h4 (OSV.dev) · EPSS by FIRST, 2026-11-26.