Mutation cross-site scripting in Nokogiri HTML5 serializer
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- None · None · None
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-79.
Summary
Nokogiri from 1.12.0 before 1.19.5 is affected on CRuby and TruffleRuby. Its HTML5 serializer does not escape text inside noscript elements or angle brackets in attribute values, an output encoding flaw (CWE-116). When an application sanitizes untrusted HTML with default parsing options, allows noscript, and sends the output to a scripting-enabled browser, the browser can parse markup Nokogiri did not produce, enabling mutation cross-site scripting. An attacker needs a user to interact with the page.
Written with Claude Haiku 5.5 from the sources below · 2026-11-14
Description from the CNA
Nokogiri is an open source XML and HTML library for the Ruby programming language. From 1.12.0 until 1.19.5, the C extension on CRuby and TruffleRuby has a Nokogiri::HTML5 serializer that does not escape text inside noscript elements or angle brackets inside attribute values. When an application sanitizes untrusted HTML with the default parsing options, allows noscript, and sends serialized output to a scripting-enabled browser, the browser can parse markup that Nokogiri did not produce, enabling mutation cross-site scripting. Using parse_noscript_content_as_text: true is the recommended workaround, not the vulnerable default. JRuby is not affected because it does not implement Nokogiri::HTML5. This issue is fixed in version 1.19.5.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| sparklemotion | nokogiri | 1.12.0 to before 1.19.5 | 1.19.5 | Patch available | CNA |
| — | nokogiri (RubyGems) | 1.12.0 to before 1.19.5 | 1.19.5 | Patch available | GHSA-4p39-36wj-23h4 |
- nokogiri Vendorsparklemotion Affected 1.12.0 to before 1.19.5 Fixed in 1.19.5 Patch available CNA
- nokogiri (RubyGems) Vendor— Affected 1.12.0 to before 1.19.5 Fixed in 1.19.5 Patch available GHSA-4p39-36wj-23h4
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:*:*:* | — | — | sparklemotion |
- cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:*:*:* Versions — — ·sparklemotion
Remediation
Upgrade the nokogiri RubyGems package to version 1.19.5. Red Hat 3scale API Management Platform 2 is listed as affected with no plan available. Using parse_noscript_content_as_text: true is the recommended workaround.
Written with Claude Haiku 5.5 from the sources below · 2026-11-14
- Fix · CNA nokogiri (sparklemotion) Fixed in 1.19.5
- Fix · GHSA-4p39-36wj-23h4 nokogiri (RubyGems) Fixed in 1.19.5 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat 3scale API Management Platform 2 | Affected | No fix yet: Fix deferred |
Timeline
- 2026-11-10 Threatist record created from CVE-2026-126063
- 2026-11-10 Alias added: GHSA-4p39-36wj-23h4
- 2026-11-10 Fix available: RubyGems/[email protected] · GHSA-4p39-36wj-23h4
- 2026-11-10 CVSS score added · GHSA-4p39-36wj-23h4
- 2026-11-10 Weakness changed · GHSA-4p39-36wj-23h4
- 2026-11-10 7 new references · GHSA-4p39-36wj-23h4
- 2026-11-13 CISA SSVC decision points changed
- 2026-11-14 Affected versions changed · Red Hat
- 2026-11-14 CVSS score added · Red Hat
References
Other 7
- 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/sparklemotion/nokogiri/releases/tag/v1.19.5
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/GHSA-4p39-36wj-23h4.yml
- https://github.com/sparklemotion/nokogiri
More sparklemotion vulnerabilities
- TI-2022-11724 Improper Handling of Unexpected Data Type in Nokogiri CVSS 3.1HIGH 8.2
- TI-2018-15259 zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if… CVSS 3.1HIGH 7.5
- TI-2026-69678 Mechanize leaks credential headers to other hosts after redirects CVSS 3.1MEDIUM 6.8
- TI-2025-05895 sparklemotion nokogiri hashmap.c hashmap_get_with_hash heap-based overflow CVSS 4.0MEDIUM 4.8
- TI-2025-05891 sparklemotion nokogiri hashmap.c hashmap_set_with_hash heap-based overflow CVSS 4.0MEDIUM 4.8
- TI-2019-03885 OS command injection in Nokogiri CVSS 3.1CRITICAL 9.8
Sources
- CVE-2026-126063 · CVE Program
- CVE-2026-126063 · NVD
- FIRST EPSS
- GHSA-4p39-36wj-23h4 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-126063 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences