nokogiri Known Vulnerabilities & Fixes
nokogiri has 38 known security vulnerabilities in RubyGems (Ruby). Upgrade to version 1.19.5 or later to resolve all known issues. Data sourced from OSV, enriched with EPSS exploit probability and CISA KEV.
High Exploitation Risk
1 vulnerability has >50% exploit probability. Review and update soon.
Recommended safe version: 1.19.5
Upgrading to 1.19.5 or later resolves all 38 known vulnerabilities in nokogiri. Run: gem install nokogiri -v 1.19.5
Is nokogiri in your project?
Check if you're affected and upgrade to 1.19.5 to stay secure.
Security Summary
- 40 affected version ranges have been identified across these 38 advisories.
- 100% of known issues have a published fixed version.
- Highest exploit-probability (EPSS) score for nokogiri: 51.7%.
- Remediation: gem update nokogiri
Vulnerabilities
38 unique vulnerabilities — sorted by exploitation risk (KEV → EPSS → CVSS). Click a CVE/GHSA ID for full details. First disclosed Dec 13, 2017, most recently Nov 10, 2026 (3254 days apart).
| CVE / GHSA | Severity |
|---|---|
| CVE-2018-25032 Nokogiri affected by zlib's Out-of-bounds Write vulnerability
| HIGH |
| CVE-2021-30560 Nokogiri has vulnerable dependencies on libxml2 and libxslt
| HIGH |
| CVE-2021-3518 Nokogiri Implements libxml2 version vulnerable to use-after-free
| HIGH |
| CVE-2021-3517 Nokogiri contains libxml Out-of-bounds Write vulnerability
| HIGH |
| CVE-2016-4658 Nokogiri does not forbid namespace nodes in XPointer ranges
| CRITICAL |
| CVE-2020-7595 libxml as used in Nokogiri has an infinite loop in a certain end-of-file situation
| HIGH |
| CVE-2017-16932 Nokogiri gem, via libxml, is affected by DoS vulnerabilities
| HIGH |
| CVE-2019-5477 Nokogiri Command Injection Vulnerability
| CRITICAL |
| CVE-2019-11068 Nokogiri vulnerable to libxslt protection mechanism bypass
| CRITICAL |
| CVE-2015-8806 Denial of service or RCE from libxml2 and libxslt
| HIGH |
| CVE-2019-13118 libxslt Type Confusion vulnerability that affects Nokogiri
| HIGH |
| CVE-2017-9050 Out-of-bounds read in nokogiri
| HIGH |
| CVE-2019-18197 Nokogiri affected by libxslt Use of Uninitialized Resource/Use After Free vulnerability
| HIGH |
| CVE-2018-14404 Nokogiri NULL Pointer Dereference
| HIGH |
| CVE-2021-3537 Nokogiri Implements libxml2 version vulnerable to null pointer dereferencing
| MEDIUM |
| CVE-2017-15412 Nokogiri gem, via libxml, is affected by DoS vulnerabilities
| HIGH |
| CVE-2022-24836 Nokogiri Inefficient Regular Expression Complexity
| HIGH |
| CVE-2017-18258 Uncontrolled resource consumption in nokogiri
| MEDIUM |
| CVE-2022-29181 Nokogiri Improperly Handles Unexpected Data Type
| HIGH |
| CVE-2017-5029 Nokogiri implementation of libxslt lacks integer overflow checks
| HIGH |
| CVE-2013-6461 Nokogiri vulnerable to DoS while parsing XML entities
| MEDIUM |
| CVE-2012-6685 Nokogiri is vulnerable to XML External Entity (XXE) attack
| HIGH |
| CVE-2022-23476 Unchecked return value from xmlTextReaderExpand
| HIGH |
| CVE-2013-6460 Nokogiri vulnerable to DoS while parsing XML documents
| MEDIUM |
| CVE-2019-5815 Nokogiri implementation of libxslt vulnerable to heap corruption
| HIGH |
| CVE-2021-41098 Improper Restriction of XML External Entity Reference (XXE) in Nokogiri on JRuby
| HIGH |
| CVE-2026-126063 Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer
| LOW |
| CVE-2026-79770 Nokogiri CSS selector tokenizer has regular expression backtracking
| HIGH |
| CVE-2026-79771 Nokogiri XSLT transform has a memory leak
| MEDIUM |
| CVE-2026-57434 Nokogiri: Null Pointer Dereference calling methods on uninitialized wrapper classes
| LOW |
| CVE-2026-57435 Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Attr#value=` or `#content=`
| LOW |
| CVE-2026-79772 Nokogiri does not check the return value from xmlC14NExecute
| MEDIUM |
| CVE-2026-57235 Nokogiri: Possible Out-of-Bounds Read in `Nokogiri::XML::NodeSet#[]`
| MEDIUM |
| CVE-2026-57236 Nokogiri: Possible Use-After-Free when `Nokogiri::XML::Document#encoding=` raises an exception
| LOW |
| CVE-2026-57436 Nokogiri: Possible Use-After-Free when setting `Document#root=` to an invalid node type
| LOW |
| CVE-2026-57437 Nokogiri: Possible Use-After-Free when directly using `NokogirI::XML::XPathContext` beyond document lifetime
| LOW |
| CVE-2025-71406 Nokogiri updates packaged libxslt to v1.1.43 to resolve multiple CVEs
| HIGH |
| CVE-2022-50999 Integer Overflow or Wraparound in libxml2 affects Nokogiri
| HIGH |
About This Data
Vulnerability data for nokogiri is sourced from the Open Source Vulnerability (OSV) database, aggregating reports from GitHub Advisory Database, NIST NVD, and ecosystem-specific sources.
CVSS (Common Vulnerability Scoring System) scores reflect exploitability and impact. EPSS (Exploit Prediction Scoring System) scores indicate the probability of exploitation within the next 30 days. Vulnerabilities marked with are listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
Related RubyGems (Ruby) Packages
Other packages in this ecosystem, ranked by shared vulnerabilities where available.
Check Your Dependencies
Scan your project to check if you're using a vulnerable version of nokogiri.