All vulnerabilities

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
Weakness
Improper output encoding (CWE-116)Cross-site scripting (CWE-79)
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.

From the GitHub Advisory Database, CC BY 4.0.

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.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
nokogiriRubyGems · osv:RubyGems:nokogiri
  • From 1.12.0 before 1.19.5

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
Search the list for nokogiri

References