nokogiri vulnerabilities

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.

Registry
RubyGems
Latest
1.19.7
License
MIT

60 known advisories

The latest version, 1.19.7, is not affected by any of them. Projects on older versions may be.

Update to the latest version:bundle update --conservative nokogiri # Gemfile: '>= 1.19.7'

Is your project on an affected nokogiri?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Security advisories for nokogiri

  • LowCVE-2026-126062GHSA-v995-44v6-5fqm10 Nov 2026

    JRuby: NONET is bypassed for external DTDs and entities when the systemId uses a short-form IPv4 host

    Affected
    <1.19.5
    Fixed in
    1.19.5
  • LowCVE-2026-126064GHSA-3w22-6jfg-527w10 Nov 2026

    Nokogiri: Use-After-Free in Nokogiri when replacing an attribute value

    Affected
    <1.19.5
    Fixed in
    1.19.5
  • LowCVE-2026-126063GHSA-4p39-36wj-23h410 Nov 2026

    Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer

    Affected
    >=1.12.0 <1.19.5
    Fixed in
    1.19.5
  • LowCVE-2026-57435GHSA-phwj-rprq-35pp19 Jun 2026

    Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Attr#value=` or `#content=`

    Affected
    <1.19.4
    Fixed in
    1.19.4
  • LowCVE-2026-57438GHSA-wfpw-mmfh-qq6919 Jun 2026

    Nokogiri: Possible Use-After-Free in XInclude Processing

    Affected
    <1.19.4
    Fixed in
    1.19.4
  • LowCVE-2026-57437GHSA-p67v-3w7g-wjg719 Jun 2026

    Nokogiri: Possible Use-After-Free when directly using `NokogirI::XML::XPathContext` beyond document lifetime

    Affected
    <1.19.4
    Fixed in
    1.19.4
  • LowCVE-2026-57436GHSA-wjv4-x9w8-wm3h19 Jun 2026

    Nokogiri: Possible Use-After-Free when setting `Document#root=` to an invalid node type

    Affected
    <1.19.4
    Fixed in
    1.19.4
  • MediumCVE-2026-57235GHSA-5prr-v3j2-97mh19 Jun 2026

    Nokogiri: Possible Out-of-Bounds Read in `Nokogiri::XML::NodeSet#[]`

    Affected
    <1.19.4
    Fixed in
    1.19.4
  • LowCVE-2026-57434GHSA-9cv2-cfxc-v4v219 Jun 2026

    Nokogiri: Null Pointer Dereference calling methods on uninitialized wrapper classes

    Affected
    <1.19.4
    Fixed in
    1.19.4
  • LowCVE-2026-57234GHSA-8678-w3jw-xfc219 Jun 2026

    Nokogiri: XML::Schema on JRuby allows network requests when NONET is set, bypassing CVE-2020-26247

    Affected
    <1.19.4
    Fixed in
    1.19.4
  • LowCVE-2026-57236GHSA-5v8h-3h3q-446p19 Jun 2026

    Nokogiri: Possible Use-After-Free when `Nokogiri::XML::Document#encoding=` raises an exception

    Affected
    <1.19.4
    Fixed in
    1.19.4
  • MediumCVE-2026-79771GHSA-v2fc-qm4h-8hqv6 May 2026

    Nokogiri XSLT transform has a memory leak

    Affected
    <1.19.3
    Fixed in
    1.19.3
  • HighCVE-2026-79770GHSA-c4rq-3m3g-8wgx6 May 2026

    Nokogiri CSS selector tokenizer has regular expression backtracking

    Affected
    <1.19.3
    Fixed in
    1.19.3
  • MediumCVE-2026-79772GHSA-wx95-c6cv-853218 Feb 2026

    Nokogiri does not check the return value from xmlC14NExecute

    Affected
    >=1.5.1 <1.19.1
    Fixed in
    1.19.1
  • CriticalGHSA-353f-x4gh-cqq821 Jul 2025

    Nokogiri patches vendored libxml2 to resolve multiple CVEs

    Affected
    <1.18.9
    Fixed in
    1.18.9
  • LowGHSA-5w6v-399v-w3cc21 Apr 2025

    Nokogiri updates packaged libxml2 to v2.13.8 to resolve CVE-2025-32414 and CVE-2025-32415

    Affected
    <1.18.8
    Fixed in
    1.18.8
  • HighGHSA-mrxw-mxhj-p66414 Mar 2025

    Nokogiri updates packaged libxslt to v1.1.43 to resolve multiple CVEs

    Affected
    <1.18.4
    Fixed in
    1.18.4
  • LowGHSA-vvfq-8hwr-qm4m18 Feb 2025

    Nokogiri updates packaged libxml2 to 2.13.6 to resolve CVE-2025-24928 and CVE-2024-56171

    Affected
    <1.18.3
    Fixed in
    1.18.3
  • LowGHSA-r95h-9x8f-r3f713 May 2024

    Nokogiri updates packaged libxml2 to v2.12.7 to resolve CVE-2024-34459

    Affected
    <1.16.5
    Fixed in
    1.16.5
  • MediumGHSA-xc9x-jj77-9p9j5 Feb 2024

    Nokogiri update packaged libxml2 to v2.12.5 to resolve CVE-2024-25062

    Affected
    >=1.16.0 <1.16.2 · <1.15.6
    Fixed in
    1.15.6, 1.16.2
  • MediumGHSA-pxvg-2qj5-37jq11 Apr 2023

    Nokogiri updates packaged libxml2 to v2.10.4 to resolve multiple CVEs

    Affected
    <1.14.3
    Fixed in
    1.14.3
  • HighCVE-2022-23476GHSA-qv4q-mr5r-qprj8 Dec 2022

    Unchecked return value from xmlTextReaderExpand

    Affected
    >=1.13.8 <1.13.10
    Fixed in
    1.13.10
  • MediumGHSA-2qc6-mcvw-92cw18 Oct 2022

    Update bundled libxml2 to v2.10.3 to resolve multiple CVEs

    Affected
    <1.13.9
    Fixed in
    1.13.9
  • HighCVE-2021-30560GHSA-59gp-qqm7-cw4j24 May 2022

    Nokogiri has vulnerable dependencies on libxml2 and libxslt

    Affected
    <1.13.2
    Fixed in
    1.13.2
  • HighCVE-2021-3517GHSA-jw9f-hh49-cvp924 May 2022

    Nokogiri contains libxml Out-of-bounds Write vulnerability

    Affected
    <1.11.4
    Fixed in
    1.11.4
  • HighCVE-2021-3518GHSA-v4f8-2847-rwm724 May 2022

    Nokogiri Implements libxml2 version vulnerable to use-after-free

    Affected
    <1.11.4
    Fixed in
    1.11.4
  • MediumCVE-2021-3537GHSA-286v-pcf5-25rc24 May 2022

    Nokogiri Implements libxml2 version vulnerable to null pointer dereferencing

    Affected
    <1.11.4
    Fixed in
    1.11.4
  • HighCVE-2019-5815GHSA-vmfx-gcfq-wvm224 May 2022

    Nokogiri implementation of libxslt vulnerable to heap corruption

    Affected
    <1.10.5
    Fixed in
    1.10.5
  • HighCVE-2019-18197GHSA-242x-7cm6-4w8j24 May 2022

    Nokogiri affected by libxslt Use of Uninitialized Resource/Use After Free vulnerability

    Affected
    <1.10.5
    Fixed in
    1.10.5
  • HighCVE-2019-13118GHSA-cf46-6xxh-pc7524 May 2022

    libxslt Type Confusion vulnerability that affects Nokogiri

    Affected
    <1.10.5
    Fixed in
    1.10.5
  • MediumCVE-2019-13117GHSA-4hm9-844j-jmxp24 May 2022

    Uninitialized read in Nokogiri gem

    Affected
    <1.10.5
    Fixed in
    1.10.5
  • HighCVE-2022-29181GHSA-xh29-r2w5-wx8m23 May 2022

    Nokogiri Improperly Handles Unexpected Data Type

    Affected
    <1.13.6
    Fixed in
    1.13.6
  • HighGHSA-cgx6-hpwq-fhv518 May 2022

    Integer Overflow or Wraparound in libxml2 affects Nokogiri

    Affected
    <1.13.5
    Fixed in
    1.13.5
  • HighCVE-2017-15412GHSA-r58r-74gx-6wx314 May 2022

    Nokogiri gem, via libxml, is affected by DoS vulnerabilities

    Affected
    <1.8.2
    Fixed in
    1.8.2
  • CriticalCVE-2019-11068GHSA-qxcg-xjjg-66mj13 May 2022

    Nokogiri vulnerable to libxslt protection mechanism bypass

    Affected
    <1.10.3
    Fixed in
    1.10.3
  • HighCVE-2017-16932GHSA-x2fm-93ww-ggvx13 May 2022

    Nokogiri gem, via libxml, is affected by DoS vulnerabilities

    Affected
    <1.8.1
    Fixed in
    1.8.1
  • MediumCVE-2013-6460GHSA-62qp-3fxm-9wxf5 May 2022

    Nokogiri vulnerable to DoS while parsing XML documents

    Affected
    >=1.5.0 <1.5.11 · >=1.6.0 <1.6.1
    Fixed in
    1.5.11, 1.6.1
  • MediumCVE-2013-6461GHSA-jmhh-w7xp-wg395 May 2022

    Nokogiri vulnerable to DoS while parsing XML entities

    Affected
    >=1.5.0 <1.5.11 · >=1.6.0 <1.6.1
    Fixed in
    1.5.11, 1.6.1
  • HighCVE-2012-6685GHSA-6wj9-77wq-jq7p23 Apr 2022

    Nokogiri is vulnerable to XML External Entity (XXE) attack

    Affected
    <1.5.4
    Fixed in
    1.5.4
  • HighGHSA-gx8x-g87m-h5q611 Apr 2022

    Denial of Service (DoS) in Nokogiri on JRuby

    Affected
    <1.13.4
    Fixed in
    1.13.4
  • MediumGHSA-xxx9-3xcr-gjj311 Apr 2022

    XML Injection in Xerces Java affects Nokogiri

    Affected
    <1.13.4
    Fixed in
    1.13.4
  • HighGHSA-v6gp-9mmm-c6p511 Apr 2022

    Out-of-bounds Write in zlib affects Nokogiri

    Affected
    <1.13.4
    Fixed in
    1.13.4
  • HighCVE-2022-24836GHSA-crjr-9rc5-ghw811 Apr 2022

    Nokogiri Inefficient Regular Expression Complexity

    Affected
    <1.13.4
    Fixed in
    1.13.4
  • HighCVE-2018-25032GHSA-jc36-42cf-vqwj26 Mar 2022

    Nokogiri affected by zlib's Out-of-bounds Write vulnerability

    Affected
    <1.13.4
    Fixed in
    1.13.4
  • HighGHSA-fq42-c5rg-92c225 Feb 2022

    Vulnerable dependencies in Nokogiri

    Affected
    <1.13.2
    Fixed in
    1.13.2
  • HighCVE-2021-41098GHSA-2rr5-8q37-2w7h27 Sept 2021

    Improper Restriction of XML External Entity Reference (XXE) in Nokogiri on JRuby

    Affected
    <1.12.5
    Fixed in
    1.12.5
  • MediumGHSA-7rrm-v45f-jp6417 May 2021

    Nokogiri updates packaged dependency on libxml2 from 2.9.10 to 2.9.12

    Affected
    <1.11.4
    Fixed in
    1.11.4
  • MediumCVE-2020-26247GHSA-vr8q-g5c7-m54m30 Dec 2020

    Nokogiri::XML::Schema trusts input by default, exposing risk of XXE vulnerability

    Affected
    <1.11.0
    Fixed in
    1.11.0
  • HighCVE-2020-7595GHSA-7553-jr98-vx4724 Feb 2020

    libxml as used in Nokogiri has an infinite loop in a certain end-of-file situation

    Affected
    <1.10.8
    Fixed in
    1.10.8
  • CriticalCVE-2019-5477GHSA-cr5j-953j-xw5p19 Aug 2019

    Nokogiri Command Injection Vulnerability

    Affected
    <1.10.4
    Fixed in
    1.10.4
  • HighCVE-2018-14404GHSA-6qvp-r6r3-9p7h17 Jan 2019

    Nokogiri NULL Pointer Dereference

    Affected
    <1.8.5
    Fixed in
    1.8.5
  • MediumCVE-2015-7499GHSA-jxjr-5h69-qw3w17 Sept 2018

    Heap-based buffer overflow in nokogiri

    Affected
    >=1.6.0 <1.6.7.2
    Fixed in
    1.6.7.2
  • HighCVE-2015-8806GHSA-7hp2-xwpj-95jq17 Sept 2018

    Denial of service or RCE from libxml2 and libxslt

    Affected
    >=1.6.0 <1.6.8
    Fixed in
    1.6.8
  • CriticalCVE-2016-4658GHSA-fr52-4hqw-p27f21 Aug 2018

    Nokogiri does not forbid namespace nodes in XPointer ranges

    Affected
    <1.7.1
    Fixed in
    1.7.1
  • HighCVE-2015-5312GHSA-xjqg-9jvg-fgx221 Aug 2018

    Nokogiri subject to DoS via libxml2 vulnerability

    Affected
    >=1.6.0 <1.6.7.1
    Fixed in
    1.6.7.1
  • MediumCVE-2015-1819GHSA-q7wx-62r7-j2x78 Aug 2018

    Nokogiri vulnerable to libxml XML Entity Expansion

    Affected
    >=1.6.6.0 <1.6.6.4
    Fixed in
    1.6.6.4
  • HighCVE-2017-5029GHSA-pf6m-fxpq-fg8v31 Jul 2018

    Nokogiri implementation of libxslt lacks integer overflow checks

    Affected
    <1.7.2
    Fixed in
    1.7.2
  • MediumCVE-2017-18258GHSA-882p-jqgm-f45g13 Apr 2018

    Uncontrolled resource consumption in nokogiri

    Affected
    <1.8.2
    Fixed in
    1.8.2
  • MediumCVE-2018-8048GHSA-x7rv-cr6v-4vm421 Mar 2018

    Cross-site Scripting in loofah

    Affected
    <1.8.3
    Fixed in
    1.8.3
  • HighCVE-2017-9050GHSA-8c56-cpmw-89x713 Dec 2017

    Out-of-bounds read in nokogiri

    Affected
    <1.8.1
    Fixed in
    1.8.1

Is your nokogiri version vulnerable?

Which of your client projects still run an old nokogiri?

NPMscan reads the Gemfile.lock in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other RubyGems packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the RubyGems registry.