RubyGems
CVE-2026-126063
Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer
- Severity
- Low
- Published
- 10 Nov 2026
- Last changed
- 10 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 1.19.5
- Exploit chance
- 0.6% in the next 30 daysHigher than 47% of CVEs. EPSS by FIRST, 24 Nov 2026
- Also known as
- GHSA-4p39-36wj-23h4
- Sources
- OSV.dev and GitHub
Description
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.
Workarounds
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.
Affected software
| Software | Affected versions |
|---|---|
nokogiriRubyGems · osv:RubyGems:nokogiri |
|
About nokogiri
- Total downloads (RubyGems)
- 1,307,106,774RubyGems, 24 Nov 2026
Vulnerabilities in nokogiri
- In our list
- 3
- Published in the last 12 months
- 3
- Critical, last 12 months
- 0
- High, last 12 months
- 0
- Known exploited
- 0
- CVE-2026-126062JRuby: NONET is bypassed for external DTDs and entities when the systemId uses a short-form IPv4 hostLow 3.7 10 Nov 2026
- CVE-2026-126064Nokogiri: Use-After-Free in Nokogiri when replacing an attribute valueLow 10 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-126063
- GitHub Advisory Database https://github.com/advisories/GHSA-4p39-36wj-23h4