Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer
CVE-2026-126063
Summary Nokogiri's HTML5 serializer did not escape text inside noscript elements, or 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 parsenoscriptcontentastext: 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 parsenoscriptcontentastext: true…
Assessment
- CVSS
- 2.3 (v4.0)
- Severity
- Low
- EPSS
- 0.00561% chance of exploitation in the next 30 days
- Known exploited
- Not listed in CISA KEV
- Exploit availability
- Nothing found in Exploit-DB, Metasploit, Nuclei or public PoC repositories
- Published
- 10 November 2026
- Last updated
- 10 November 2026
- Affected
- nokogiri
- Weakness
- CWE-116, CWE-79
CVSS vectorCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
At the source
References
- https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-4p39-36wj-23h4
- https://github.com/sparklemotion/nokogiri/pull/3752
- https://github.com/sparklemotion/nokogiri/commit/3e84df6ff7ab4d78f446e3a415430bd69a055d32
- https://github.com/sparklemotion/nokogiri/commit/c6c0bffbdcd194694995acafeeed27326b0805f8
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/GHSA-4p39-36wj-23h4.yml
- https://github.com/sparklemotion/nokogiri/releases/tag/v1.19.5
- https://github.com/advisories/GHSA-4p39-36wj-23h4
Community proofs of concept
No community proof of concept yet. If you have one for a published vulnerability and the right to share it, add it below — it will appear here once reviewed.
Submit a proof of concept
Only for publicly disclosed vulnerabilities, and only material from testing you were authorised to perform. This platform does not buy, sell, or broker exploits — see earning from vulnerability research for legitimate bounty programs. Submissions are reviewed before they appear. Text only; do not include live credentials, personal data, or anything targeting systems you are not permitted to test.
Query this programmatically
Agents can read this through the MCP endpoint, or over HTTP:
curl https://cve.zerocrew.in/api/cve/CVE-2026-126063