LiveActive security incident?Get immediate response
CVE Record

CVE-2024-58378: Nokogiri before 1.16.2 Use-After-Free via xmlTextReader

Nokogiri before 1.15.6 and 1.16.x before 1.16.2 (CRuby, when using the packaged libxml2) is affected by a use-after-free vulnerability in libxml2 (CVE-2024-25062) in the xmlTextReader module, which underlies Nokogiri::XML::Reader. When using the XML Reader interface with DTD validation and XInclude expansion enabled, processing a crafted XML document can lead to an xmlValidatePopElement use-after-free. Nokogiri 1.15.6 and 1.16.2 resolve this by upgrading the packaged libxml2 to 2.11.7 and 2.12.5 respectively. JRuby and installations using system libxml2 are not affected.

CriticalCVSS 9.8Not KEV-listedUpdated
Glexia's TakeAutomated analysiscritical

Security readout for executives and security teams

Plain-English summary

A crafted XML file can trigger unsafe memory reuse in vulnerable Nokogiri installations. Applications are exposed only when they run CRuby with Nokogiri’s packaged libxml2 and process XML through the Reader interface with both DTD validation and XInclude expansion enabled. Successful triggering could compromise confidentiality, integrity, or availability according to the supplied CVSS assessment.

Executive priority

Treat as an urgent, targeted remediation rather than assuming universal Nokogiri exposure. Immediately identify internet-facing or externally fed XML workflows meeting all required conditions, then upgrade them first. The critical score supports rapid action, while the narrow configuration requirements and absence of confirmed active exploitation support evidence-based prioritization.

Technical view

CVE-2024-58378 is a CWE-416 use-after-free inherited from packaged libxml2 CVE-2024-25062. During crafted XML processing, the xmlTextReader path underlying Nokogiri::XML::Reader can reach an xmlValidatePopElement use-after-free when DTD validation and XInclude expansion are enabled. JRuby and system-libxml2 installations are excluded by the supplied advisory.

Likely exposure

Prioritize CRuby applications using Nokogiri versions before 1.15.6, or 1.16.x before 1.16.2, with packaged libxml2. Practical exposure additionally requires Nokogiri::XML::Reader, DTD validation, XInclude expansion, and attacker-influenced XML. Applications lacking any required condition are unlikely to expose this specific path.

Exploitation context

The supplied CVSS is 9.8, reflecting a network-reachable, low-complexity, unauthenticated condition with potentially severe impact. However, the bundle reports that this CVE is not in KEV and provides no evidence of active exploitation or a public working exploit. Treat exploit status as unconfirmed.

Researcher notes

The vulnerable behavior originates in libxml2’s xmlTextReader module and maps to CVE-2024-25062. Assessment should verify the runtime library source, not only the gem version. The supplied affected-version records appear range-oriented and potentially ambiguous; use the explicit advisory boundaries: before 1.15.6 and 1.16.x before 1.16.2.

Mitigation direction

  • Upgrade affected 1.15.x installations to Nokogiri 1.15.6 or later.
  • Upgrade affected 1.16.x installations to Nokogiri 1.16.2 or later.
  • Until upgraded, avoid processing untrusted XML with both DTD validation and XInclude expansion enabled.
  • Confirm deployed Nokogiri uses the expected patched packaged libxml2 version.

Validation and detection

  • Inventory Nokogiri versions, Ruby runtime type, and whether packaged or system libxml2 is used.
  • Identify code paths using Nokogiri::XML::Reader with DTD validation and XInclude expansion.
  • Trace whether attacker-controlled or externally supplied XML reaches those code paths.
  • Verify Nokogiri 1.15.6 packages libxml2 2.11.7, or 1.16.2 packages libxml2 2.12.5.
  • Run existing defensive XML-processing tests after upgrading.
Prepared
Confidence
high
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-416: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2024-58378 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Critical
CVSS
9.8 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
3Timeline events
0ADP providers
4Source links

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
9.8CVSS 3.1CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H3.95.9VulnCheck
9.3CVSS 4.0CriticalCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NVulnCheck

Vulnerability scoring details

Base CVSS 4.0 score

9.3Critical
CVSS 4.0 vector shape for CVE-2024-58378Attack VectorAttack ComplexityAttack RequirementsPrivileges RequiredUser InteractionVS ConfidentialityVS IntegrityVS AvailabilitySS ConfidentialitySS IntegritySS Availability

Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Attack Requirements
NonePresent
Privileges Required
NoneLowHigh
User Interaction
NonePassiveActive
VS Confidentiality
HighLowNone
VS Integrity
HighLowNone
VS Availability
HighLowNone
SS Confidentiality
HighLowNone
SS Integrity
HighLowNone
SS Availability
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
sparklemotionnokogiri1.16.0, 1.16.2unaffected
sparklemotionnokogiri0, 1.15.6unaffected
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-416 · source CWE mapping

Use After Free

Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.