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

Published Aug 25, 2026
·
Updated

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.

Affected Software

4 affected components
pypi/Nokogiri
nokogiri/nokogiri>0<=1.15.5, >1.16.0<=1.16.1
ruby/nokogiri<1.15.6, >1.16.0<1.16.2
Nokogiri libxml2=2.11.7, =2.12.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade nokogiri to a version that resolves this vulnerability.

    Fixed in 1.15.6
  2. Upgrade

    Upgrade nokogiri to a version that resolves this vulnerability.

    Fixed in 1.16.2
  3. Compensating control

    If using Nokogiri versions before 1.16.2, avoid the XML Reader interface with DTD validation and XInclude expansion enabled to prevent the xmlTextReader use-after-free (CVE-2024-25062) in the xmlTextReader module underlying Nokogiri::XML::Reader.

Event History

Aug 25, 2026
CVE Published
via MITRE·03:15 PM
Data Sourced
via MITRE·03:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:16 PM
DescriptionSeverityWeakness

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203