Install
nokogiri
Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is fast and standards-compliant by relying on native parsers like libxml2, libgumbo, or xerces.
1.19.7Latest, 2 Nov 2026
1.3BDownloads, all time
0Advisories on the latest
40Advisories, all versions
MITLicence
6.3KStars
7.5/10OpenSSF Scorecard
Source · Homepage · Ask AI Mode · · Markdown
Known advisories
| Severity | Advisory | Fix | Published |
|---|---|---|---|
| Low | Nokogiri: Use-After-Free in Nokogiri when replacing an attribute value CVE-2026-126064 | Fixed in 1.19.5 | 10 Nov 2026 |
| Low | Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer CVE-2026-126063 | Fixed in 1.19.5 | 10 Nov 2026 |
| Low | JRuby: NONET is bypassed for external DTDs and entities when the systemId uses a short-form IPv4 host CVE-2026-126062 | Fixed in 1.19.5 | 10 Nov 2026 |
| Moderate | Nokogiri: Possible Out-of-Bounds Read in `Nokogiri::XML::NodeSet#[]` CVE-2026-57235 | Fixed in 1.19.4 | 19 Jun 2026 |
| Low | Nokogiri: Possible Use-After-Free when `Nokogiri::XML::Document#encoding=` raises an exception CVE-2026-57236 | Fixed in 1.19.4 | 19 Jun 2026 |
| Low | Nokogiri: XML::Schema on JRuby allows network requests when NONET is set, bypassing CVE-2020-26247 CVE-2026-57234 | Fixed in 1.19.4 | 19 Jun 2026 |
| Low | Nokogiri: Null Pointer Dereference calling methods on uninitialized wrapper classes CVE-2026-57434 | Fixed in 1.19.4 | 19 Jun 2026 |
| Low | Nokogiri: Possible Use-After-Free when directly using `NokogirI::XML::XPathContext` beyond document lifetime CVE-2026-57437 | Fixed in 1.19.4 | 19 Jun 2026 |
| Low | Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Attr#value=` or `#content=` CVE-2026-57435 | Fixed in 1.19.4 | 19 Jun 2026 |
| Low | Nokogiri: Possible Use-After-Free in XInclude Processing CVE-2026-57438 | Fixed in 1.19.4 | 19 Jun 2026 |
| Low | Nokogiri: Possible Use-After-Free when setting `Document#root=` to an invalid node type CVE-2026-57436 | Fixed in 1.19.4 | 19 Jun 2026 |
| High | Nokogiri CSS selector tokenizer has regular expression backtracking CVE-2026-79770 | Fixed in 1.19.3 | 6 May 2026 |
| Moderate | Nokogiri XSLT transform has a memory leak CVE-2026-79771 | Fixed in 1.19.3 | 6 May 2026 |
| Moderate | Nokogiri does not check the return value from xmlC14NExecute CVE-2026-79772 | Fixed in 1.19.1 | 18 Feb 2026 |
| Critical | Nokogiri patches vendored libxml2 to resolve multiple CVEs GHSA-353f-x4gh-cqq8 | Fixed in 1.18.9 | 21 Jul 2025 |
In the news
- Fixing the Nokogiri/Gumbo Build Error on Termux (Metasploit 2026) dev.to, 16 Jan 2026
- Problem with nokogiri as a dependency - Rails 7.1 - Ubuntu 22.04 stackoverflow.com, 2 Jan 2025
- How to resolve uninitialized constant Nokogiri::HTML4 using Ruby in Rails stackoverflow.com, 21 Dec 2024
- Receiving "cannot load such file -- nokogiri (LoadError)" when using Docker and docker-compose stackoverflow.com, 17 Dec 2024
On Hacker News
- Nokolexbor: Drop-in replacement for Nokogiri. 5.2x faster at parsing HTML 77 points, 11 comments, 17 Nov 2024
- Webcrawling at Scale with Nokogiri and IronWorker: Part 2 38 points, 2 comments, 17 Sep 2012
Sources: RubyGems, deps.dev (CC BY 4.0), OSV. Last checked 3 Dec 2026.