Advisory

GHSA-9cv2-cfxc-v4v2

Also known as: CVE-2026-57434

Summary

Nokogiri: Null Pointer Dereference calling methods on uninitialized wrapper classes

Details

Summary

Nokogiri contains a bug when calling certain methods on allocated-but-uninitialized native wrapper classes that inherit from Nokogiri::XML::Node. This caused a NULL pointer dereference that could crash the process.

Nokogiri 1.19.4 checks for missing native data pointers and raises a RuntimeError.

JRuby is not affected.

Severity

The Nokogiri maintainers have evaluated this as low severity. This is only triggered by a programming error. It requires application code to call .allocate directly on a native-backed class and then invoke methods on the resulting uninitialized object. It cannot be triggered by untrusted input or through normal use of the public API.

Mitigation

Upgrade to Nokogiri 1.19.4 or later.

Avoid calling .allocate directly on Nokogiri native-backed classes. Use the documented constructors and factory methods instead.

Credit

This issue was responsibly reported by Zheng Yu from depthfirst.com.

Severity

Low Basis: The source's own band: LOW

Dates

Published
2026-06-19 16:36 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

nokogiri

RubyGems · All systems

Affected

  • introduced 0, fixed 1.19.4 (ecosystem)

Fixed versions

1.19.4

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences