Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-41098

Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. In Nokogiri v1.12.4 and earlier, on JRuby only, the SAX parser resolves external entities by default. Users of Nokogiri on JRuby who parse untrusted documents using any of these classes are affected: Nokogiri::XML::SAX::Parse, Nokogiri::HTML4::SAX::Parser or its alias Nokogiri::HTML::SAX::Parser, Nokogiri::XML::SAX::PushParser, and Nokogiri::HTML4::SAX::PushParser or its alias Nokogiri::HTML::SAX::PushParser. JRuby users should upgrade to Nokogiri v1.12.5 or later to receive a patch for this issue. There are no workarounds available for v1.12.4 or earlier. CRuby users are not affected.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-41098
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:20 UTC · Revision 1

Source evidence

CVE-2021-41098

core-osv · Original source

Published 27 Sept 2021, 20:15 UTC

Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. In Nokogiri v1.12.4 and earlier, on JRuby only, the SAX parser resolves external entities by default. Users of Nokogiri on JRuby who parse untrusted documents using any of these classes are affected: Nokogiri::XML::SAX::Parse, Nokogiri::HTML4::SAX::Parser or its alias Nokogiri::HTML::SAX::Parser, Nokogiri::XML::SAX::PushParser, and Nokogiri::HTML4::SAX::PushParser or its alias Nokogiri::HTML::SAX::PushParser. JRuby users should upgrade to Nokogiri v1.12.5 or later to receive a patch for this issue. There are no workarounds available for v1.12.4 or earlier. CRuby users are not affected.

osv:CVE-2021-41098
Complete source record
{
  "id": "1b6830d26394146196134c99d585ddc3d0fb5346536c8aa9df0bcc7f8da1305e",
  "url": "https://osv.dev/vulnerability/CVE-2021-41098",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-41098",
    "summary": "Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. In Nokogiri v1.12.4 and earlier, on JRuby only, the SAX parser resolves external entities by default. Users of Nokogiri on JRuby who parse untrusted documents using any of these classes are affected: Nokogiri::XML::SAX::Parse, Nokogiri::HTML4::SAX::Parser or its alias Nokogiri::HTML::SAX::Parser, Nokogiri::XML::SAX::PushParser, and Nokogiri::HTML4::SAX::PushParser or its alias Nokogiri::HTML::SAX::PushParser. JRuby users should upgrade to Nokogiri v1.12.5 or later to receive a patch for this issue. There are no workarounds available for v1.12.4 or earlier. CRuby users are not affected.",
    "evidence": "osv:CVE-2021-41098",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-41098",
      "aliases": [
        "CVE-2021-41098",
        "GHSA-2rr5-8q37-2w7h"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/sparklemotion/nokogiri",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "47f6a461fdc3e375b30522259e48569fb578dece"
                },
                {
                  "fixed": "5bf729ff3cc84709ee3c3248c981584088bf9f6d"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.12.5"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "5bf729ff3cc84709ee3c3248c981584088bf9f6d"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.12.4",
            "v1.12.3",
            "v1.12.2",
            "v1.12.1",
            "v1.12.0",
            "v1.12.0.rc1",
            "v1.11.3",
            "v1.11.2",
            "v1.11.1",
            "v1.11.0",
            "v1.11.0.rc4",
            "v1.11.0.rc3",
            "v1.11.0.rc2",
            "v1.11.0.rc1",
            "v1.10.3",
            "v1.10.2",
            "v1.8.5",
            "v1.10.1",
            "v1.10.0",
            "v1.10.0.rc1",
            "v1.9.1",
            "v1.9.0",
            "v1.9.0.rc1",
            "v1.8.4",
            "v1.8.3",
            "v1.8.2",
            "v1.8.1",
            "v1.8.0",
            "v1.7.0.1",
            "v1.7.0",
            "v1.6.8",
            "v1.6.8.rc3",
            "v1.6.8.rc2",
            "v1.6.8.rc1",
            "v1.6.7.rc4",
            "v1.6.6.2",
            "v1.6.7.rc3",
            "v1.6.7.rc2",
            "v1.6.7.rc1",
            "1.7.0.1-linux-binary1",
            "v1.6.6.1",
            "v1.6.6",
            "v1.6.5",
            "v1.6.4",
            "v1.6.3.1",
            "v1.6.3",
            "v1.6.3.rc3",
            "v1.6.3.rc2",
            "v1.6.3.rc1",
            "v1.6.2.1",
            "v1.6.2",
            "v1.6.2.rc3",
            "v1.6.2.rc1",
            "v1.6.2.beta.1",
            "v1.6.0",
            "v1.5.9",
            "v1.6.0.rc1",
            "v1.5.8",
            "v1.5.7",
            "v1.5.7.rc3",
            "v1.5.7.rc2",
            "v1.5.7.rc1",
            "v1.5.6",
            "v1.5.6.rc2",
            "v1.5.5.rc2",
            "v1.5.5.rc1",
            "v1.5.4.rc3",
            "v1.5.4.rc2",
            "v1.5.4.rc1",
            "v1.5.3",
            "v1.5.3.rc6",
            "v1.5.3.rc5",
            "v1.5.3.rc4",
            "v1.5.3.rc3",
            "v1.5.3.rc1",
            "v1.5.2",
            "v1.5.1",
            "v1.5.1.rc1",
            "v1.5.0",
            "v1.5.0.beta.3",
            "v1.5.0.beta.4",
            "REL_1.5.0.beta.2",
            "REL_1.5.0.beta.1",
            "REL_1.0.7",
            "REL_1.0.6",
            "REL_1.0.5",
            "REL_1.0.4",
            "REL_1.0.3",
            "REL_1.0.2",
            "REL_1.0.1",
            "REL_1.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-41098.json"
          }
        }
      ],
      "modified": "2026-10-20T10:53:55.979931995Z",
      "provider": "osv",
      "references": [
        "https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-2rr5-8q37-2w7h",
        "https://github.com/sparklemotion/nokogiri/commit/5bf729ff3cc84709ee3c3248c981584088bf9f6d"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-41098",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 384770,
  "published_at": "2021-09-27T20:15:07.397+00:00"
}