Executive brief
Nokogiri is a popular XML and HTML parser library used in Ruby applications. A memory leak in its XSLT transform feature allows attackers to send specially crafted input containing null bytes, which causes small heap allocations to leak. For long-running web applications or services that process untrusted data through XSLT transforms, sustained attacks could exhaust available memory and cause service outages.
Technical details
This vulnerability is a memory leak (CWE-401) in Nokogiri::XSLT::Stylesheet#transform when handling Ruby strings containing null bytes passed as transformation parameters. The root cause is insufficient memory tracking and release during string parameter processing. The attack vector is network-based with no authentication required; an attacker can pass malicious input directly to XSLT transform parameters. Each leaked allocation is approximately 24–32 bytes, so meaningful memory exhaustion requires sustained, high-rate attacker-controlled traffic. The vulnerability does not cause memory corruption or information disclosure, only availability impact through gradual memory consumption. The fix is available in Nokogiri version 1.19.3 and later. Applications can also mitigate by validating untrusted input before passing it to transform parameters.
Affected products
- Nokogiri Nokogiri < 1.19.3
Timeline
- 2026-04-27: disclosed: Original advisory GHSA-v2fc-qm4h-8hqv published
- 2026-08-25: advisory: Duplicate advisory GHSA-rh9x-7xjc-vwx2 published to NVD and GitHub Advisory Database
- 2026: patched: Fix available in Nokogiri 1.19.3