CVE-2024-58378
Received
Received - Intake
Use-After-Free in Nokogiri with libxml2
Vulnerability report for CVE-2024-58378, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.
Publication date: 2026-08-25
Last updated on: 2026-08-25
Assigner: VulnCheck
Description
Description
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.
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| sparklemotion | nokogiri | From 1.15.6 (exc) to 1.16.2 (exc) |
| sparklemotion | nokogiri | From 1.16.2 (inc) |
| sparklemotion | nokogiri | From 1.15.0 (inc) to 1.15.6 (exc) |
| nokogiri | nokogiri | From 1.16.0 (inc) to 1.16.2 (exc) |
| libxml2 | libxml2 | 2.11.7 |
| libxml2 | libxml2 | 2.12.5 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-416 | The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. |