CVE-2019-13118: Nokogiri Libxslt Type Confusion Vulnerability That Vulnerability

HIGH
Advisory Identifier: GHSA-cf46-6xxh-pc75
CVSS 7.5
CWE-843
Published
Advisory Summary

CVE-2019-13118 is a HIGH (CVSS 7.5) libxslt type confusion vulnerability that vulnerability (CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')) affecting Nokogiri libraries in the RubyGems ecosystem. The issue involves libxslt type confusion vulnerability that affects nokogiri. Remediation is available by upgrading affected packages to version 1.10.5.

CVE-2019-13118 at a Glance

CVE Identifier CVE-2019-13118
GHSA Identifier GHSA-cf46-6xxh-pc75
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')
Affected Product Nokogiri
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2019-13118

To remediate this vulnerability, upgrade all affected Nokogiri dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nokogiri fixed: 1.10.5
Upgrade nokogiri to 1.10.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for nokogiri

How to Check if You Are Affected

To determine whether your application is affected by CVE-2019-13118, inspect your project dependencies for Nokogiri:

inspect dependencies for nokogiri

Analyze the terminal output to locate any version of Nokogiri in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion'), where the product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. In Nokogiri, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In `numbers.c` in libxslt 1.1.33, a type holding grouping characters of an `xsl:number` instruction was too narrow and an invalid character/length combination could be passed to `xsltNumberFormatDecimal`, leading to a read of uninitialized stack data. Nokogiri prior to version 1.10.5 used a vulnerable version of libxslt. Nokogiri 1.10.5 updated libxslt to version 1.1.34 to address this and other vulnerabilities in libxslt.

CVE-2019-13118 Affected Nokogiri Versions

1 component(s)
Fixed Versions:
1.10.5
Product / Package Ecosystem Affected Versions Fixed Version
nokogiri
RubyGems
< 1.10.5
1.10.5

References

NVD — CVE-2019-13118 NVD
https://nvd.nist.gov/vuln/detail/CVE-2019-13118
Nokogiri Source Repository REPOSITORY
https://github.com/sparklemotion/nokogiri/issues/1943
Security Fix Commit FIX COMMIT
https://github.com/sparklemotion/nokogiri/commit/43a175339b47b8c604508813fc75b83f13cd173e
bugs.chromium.org/p/oss-fuzz/issues/d... WEB
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15069
seclists.org/bugtraq/2019/jul/36 WEB
https://seclists.org/bugtraq/2019/Jul/36
seclists.org/bugtraq/2019/jul/37 WEB
https://seclists.org/bugtraq/2019/Jul/37
seclists.org/bugtraq/2019/jul/40 WEB
https://seclists.org/bugtraq/2019/Jul/40
seclists.org/bugtraq/2019/jul/41 WEB
https://seclists.org/bugtraq/2019/Jul/41
seclists.org/bugtraq/2019/jul/42 WEB
https://seclists.org/bugtraq/2019/Jul/42
Nokogiri Security Information SECURITY
https://security.netapp.com/advisory/ntap-20190806-0004
Nokogiri Security Information SECURITY
https://security.netapp.com/advisory/ntap-20200122-0003
support.apple.com/kb/ht210346 WEB
https://support.apple.com/kb/HT210346
support.apple.com/kb/ht210348 WEB
https://support.apple.com/kb/HT210348
support.apple.com/kb/ht210351 WEB
https://support.apple.com/kb/HT210351
support.apple.com/kb/ht210353 WEB
https://support.apple.com/kb/HT210353
support.apple.com/kb/ht210356 WEB
https://support.apple.com/kb/HT210356
support.apple.com/kb/ht210357 WEB
https://support.apple.com/kb/HT210357
support.apple.com/kb/ht210358 WEB
https://support.apple.com/kb/HT210358
usn.ubuntu.com/4164-1 WEB
https://usn.ubuntu.com/4164-1
Nokogiri Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2020.html
Nokogiri Source Repository REPOSITORY
https://github.com/sparklemotion/nokogiri/blob/f7aa3b0b29d6fe5fafe93dacd9b96b6b3d16b7ec/CHANGELOG.md?plain=1#L796
Nokogiri Release RELEASE
https://github.com/sparklemotion/nokogiri/releases/tag/v1.10.5
gitlab.gnome.org/gnome/libxslt/commi... WEB
https://gitlab.gnome.org/GNOME/libxslt/commit/6ce8de69330783977dd14f6569419489875fb71b
lists.apache.org/thread.html/r58af02... WEB
https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E
lists.apache.org/thread.html/r58af02... WEB
https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b@%3Cissues.bookkeeper.apache.org%3E
lists.apache.org/thread.html/rf4c027... WEB
https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E
lists.apache.org/thread.html/rf4c027... WEB
https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4@%3Cissues.bookkeeper.apache.org%3E
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2019/07/msg00020.html
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IOYJKXPQCUNBMMQJWYXOR6QRUJZHEDRZ
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IOYJKXPQCUNBMMQJWYXOR6QRUJZHEDRZ
oss-fuzz.com/testcase-detail/519... WEB
https://oss-fuzz.com/testcase-detail/5197371471822848
seclists.org/bugtraq/2019/aug/21 WEB
https://seclists.org/bugtraq/2019/Aug/21
seclists.org/bugtraq/2019/aug/22 WEB
https://seclists.org/bugtraq/2019/Aug/22
seclists.org/bugtraq/2019/aug/23 WEB
https://seclists.org/bugtraq/2019/Aug/23
seclists.org/bugtraq/2019/aug/25 WEB
https://seclists.org/bugtraq/2019/Aug/25
seclists.org/bugtraq/2019/jul/35 WEB
https://seclists.org/bugtraq/2019/Jul/35
Nokogiri Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00062.html
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Aug/11
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Aug/13
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Aug/14
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Aug/15
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Jul/22
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Jul/23
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Jul/24
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Jul/26
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Jul/31
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Jul/37
seclists.org/fulldisclosure/2019... WEB
http://seclists.org/fulldisclosure/2019/Jul/38
Nokogiri Security Information SECURITY
http://www.openwall.com/lists/oss-security/2019/11/17/2

Frequently Asked Questions

What is CVE-2019-13118?
CVE-2019-13118 is a security vulnerability in Nokogiri involving libxslt Type Confusion vulnerability that affects Nokogiri under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion').
Which Nokogiri versions are affected?
Affected versions include releases prior to 1.10.5 across affected packages: nokogiri.
What version fixes CVE-2019-13118?
Upgrading to 1.10.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nokogiri affected?
Yes, nokogiri is affected in releases prior to 1.10.5. Upgrade your dependency to 1.10.5 or later.
What is the CVSS score of CVE-2019-13118?
CVE-2019-13118 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2019-13118?
CVE-2019-13118 is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') (The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.).
How can I check RubyGems dependencies for CVE-2019-13118?
Run the dependency tree command: 'inspect dependencies for nokogiri'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cf46-6xxh-pc75",
  "modified" : "2026-06-09T10:21:50Z",
  "published" : "2022-05-24T16:49:07Z",
  "aliases" : [ "CVE-2019-13118" ],
  "summary" : "libxslt Type Confusion vulnerability that affects Nokogiri",
  "details" : "In `numbers.c` in libxslt 1.1.33, a type holding grouping characters of an `xsl:number` instruction was too narrow and an invalid character/length combination could be passed to `xsltNumberFormatDecimal`, leading to a read of uninitialized stack data.\n\nNokogiri prior to version 1.10.5 used a vulnerable version of libxslt. Nokogiri 1.10.5 updated libxslt to version 1.1.34 to address this and other vulnerabilities in libxslt.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "nokogiri"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.10.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-13118"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/nokogiri/issues/1943"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/nokogiri/commit/43a175339b47b8c604508813fc75b83f13cd173e"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15069"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Jul/36"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Jul/37"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Jul/40"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Jul/41"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Jul/42"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20190806-0004"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20200122-0003"
  }, {
    "type" : "WEB",
    "url" : "https://support.apple.com/kb/HT210346"
  }, {
    "type" : "WEB",
    "url" : "https://support.apple.com/kb/HT210348"
  }, {
    "type" : "WEB",
    "url" : "https://support.apple.com/kb/HT210351"
  }, {
    "type" : "WEB",
    "url" : "https://support.apple.com/kb/HT210353"
  }, {
    "type" : "WEB",
    "url" : "https://support.apple.com/kb/HT210356"
  }, {
    "type" : "WEB",
    "url" : "https://support.apple.com/kb/HT210357"
  }, {
    "type" : "WEB",
    "url" : "https://support.apple.com/kb/HT210358"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4164-1"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2020.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/nokogiri/blob/f7aa3b0b29d6fe5fafe93dacd9b96b6b3d16b7ec/CHANGELOG.md?plain=1#L796"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/nokogiri/releases/tag/v1.10.5"
  }, {
    "type" : "WEB",
    "url" : "https://gitlab.gnome.org/GNOME/libxslt/commit/6ce8de69330783977dd14f6569419489875fb71b"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b@%3Cissues.bookkeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4@%3Cissues.bookkeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2019/07/msg00020.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IOYJKXPQCUNBMMQJWYXOR6QRUJZHEDRZ"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IOYJKXPQCUNBMMQJWYXOR6QRUJZHEDRZ"
  }, {
    "type" : "WEB",
    "url" : "https://oss-fuzz.com/testcase-detail/5197371471822848"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Aug/21"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Aug/22"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Aug/23"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Aug/25"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Jul/35"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00062.html"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Aug/11"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Aug/13"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Aug/14"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Aug/15"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Jul/22"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Jul/23"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Jul/24"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Jul/26"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Jul/31"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Jul/37"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2019/Jul/38"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2019/11/17/2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-843" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-08T19:57:56Z",
    "nvd_published_at" : "2019-07-01T02:15:00Z"
  }
}