CVE-2026-126063 — Vulnerability in nokogiri — CVE Details
Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.55%). Schedule for your next planned update.
Does your project use an affected nokogiri version?
Paste your Gemfile.lock to check it for CVE-2026-126063 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Advisory Timeline
- First published November 10, 2026 (16 days ago).
- Last revised November 10, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install nokogiri -v 1.19.5
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| nokogiri RubyGems · Affected: 1.12.0, 1.12.1, 1.12.2, 1.12.3 (+58 more) | 1.19.5 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 5.7 score means for each attack dimension.
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
References
- https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-4p39-36wj-23h4WEB
- https://github.com/sparklemotion/nokogiri/pull/3752WEB
- https://github.com/sparklemotion/nokogiri/commit/3e84df6ff7ab4d78f446e3a415430bd69a055d32WEB
- https://github.com/sparklemotion/nokogiri/commit/c6c0bffbdcd194694995acafeeed27326b0805f8WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/GHSA-4p39-36wj-23h4.ymlWEB
- https://github.com/sparklemotion/nokogiriPACKAGE
- https://github.com/sparklemotion/nokogiri/releases/tag/v1.19.5WEB
Frequently Asked Questions
- What is CVE-2026-126063?
- Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer. This vulnerability has been assigned a severity rating of LOW (CVSS score: 5.7/10).
- How do I check if my project is affected by CVE-2026-126063?
- CVE-2026-126063 affects nokogiri. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-126063 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is a below-median EPSS score — only 39.4% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2019-5477CRITICAL
Nokogiri Command Injection Vulnerability
- CVE-2016-4658CRITICAL
Nokogiri does not forbid namespace nodes in XPointer ranges
- CVE-2019-13118HIGH
libxslt Type Confusion vulnerability that affects Nokogiri
- CVE-2022-50999HIGH
Integer Overflow or Wraparound in libxml2 affects Nokogiri
- CVE-2022-24836HIGH
Nokogiri Inefficient Regular Expression Complexity
- CVE-2018-25032HIGH
Nokogiri affected by zlib's Out-of-bounds Write vulnerability
- CVE-2021-3517HIGH
Nokogiri contains libxml Out-of-bounds Write vulnerability
- CVE-2013-6461MEDIUM
Nokogiri vulnerable to DoS while parsing XML entities