Description
Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, Nokogiri::XML::XPathContext did not keep its source document alive for garbage collection. If an XPathContext outlived its document and the document was collected, evaluating an XPath expression could read invalid memory and potentially segfault. This is only reachable when application code constructs an XPathContext directly and lets the document become unreachable while continuing to use the context. The normal Document#xpath, #css, and related search methods are not affected, and it is not triggerable by malicious document input. This vulnerability is fixed in 1.19.4.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| sparklemotion | nokogiri | < 1.19.4 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | ruby-nokogiri | 1.19.4+dfsg-1 | — |
| Debian 13 | ruby-nokogiri | No fix yet | — |
| Debian 12 | ruby-nokogiri | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | ruby-nokogiri | No fix yet | — |
| Ubuntu 26.04 LTS | ruby-nokogiri | No fix yet | — |
| Ubuntu 25.10 | ruby-nokogiri | No fix yet | — |
| Ubuntu 24.04 LTS | ruby-nokogiri | No fix yet | — |
| Ubuntu 18.04 LTS | ruby-nokogiri | No fix yet | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | ruby-nokogiri | No fix yet | — |
| Ubuntu Pro 22.04 LTS | ruby-nokogiri | No fix yet | — |
| Ubuntu Pro 20.04 LTS | ruby-nokogiri | No fix yet | — |
| Ubuntu Pro 14.04 LTS | ruby-nokogiri | No fix yet | — |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | ruby-nokogiri | 1.19.4-r0 | — |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | rubygem-nokogiri | 1.19.4-1 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| RubyGems | nokogiri | < 1.19.4 | 1.19.4 | GHSA-p67v-3w7g-wjg7 |