GHSA-9cv2-cfxc-v4v2: Nokogiri Null Pointer Dereference Calling Methods Vulnerability
LOWGHSA-9cv2-cfxc-v4v2 is a LOW null pointer dereference calling methods vulnerability (CWE-476: NULL Pointer Dereference) affecting Nokogiri libraries in the RubyGems ecosystem. The issue involves null pointer dereference calling methods on uninitialized wrapper classes. Remediation is available by upgrading affected packages to version 1.19.4.
GHSA-9cv2-cfxc-v4v2 at a Glance
How to Fix GHSA-9cv2-cfxc-v4v2
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.
Upgrade nokogiri to 1.19.4
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 GHSA-9cv2-cfxc-v4v2, 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.19.4), 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-476: NULL Pointer Dereference, where the product dereferences a pointer that it expects to be valid but is null. 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
GHSA-9cv2-cfxc-v4v2 Affected Nokogiri Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nokogiri
|
RubyGems |
< 1.19.4
|
1.19.4
|
References
Frequently Asked Questions
What is GHSA-9cv2-cfxc-v4v2?
Which Nokogiri versions are affected?
What version fixes GHSA-9cv2-cfxc-v4v2?
Is nokogiri affected?
What CWE is associated with GHSA-9cv2-cfxc-v4v2?
How can I check RubyGems dependencies for GHSA-9cv2-cfxc-v4v2?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9cv2-cfxc-v4v2",
"modified" : "2026-06-19T16:36:23Z",
"published" : "2026-06-19T16:36:23Z",
"aliases" : [ ],
"summary" : "Nokogiri: Null Pointer Dereference calling methods on uninitialized wrapper classes",
"details" : "### Summary\n\nNokogiri 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.\n\nNokogiri 1.19.4 checks for missing native data pointers and raises a `RuntimeError`.\n\nJRuby is not affected.\n\n### Severity\n\nThe 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.\n\n### Mitigation\n\nUpgrade to Nokogiri 1.19.4 or later.\n\nAvoid calling `.allocate` directly on Nokogiri native-backed classes. Use the documented constructors and factory methods instead.\n\n### Credit\n\nThis issue was responsibly reported by Zheng Yu from depthfirst.com.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "nokogiri"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.19.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-9cv2-cfxc-v4v2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sparklemotion/nokogiri"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-476" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-19T16:36:23Z",
"nvd_published_at" : null
}
}