GHSA-r95h-9x8f-r3f7: Nokogiri Nokogiri Updates Packaged Libxml2 To Vulnerability
LOWGHSA-r95h-9x8f-r3f7 is a LOW nokogiri updates packaged libxml2 to vulnerability (CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')) affecting Nokogiri libraries in the RubyGems ecosystem. The issue involves nokogiri updates packaged libxml2 to v2.12.7 to resolve cve-2024-34459. Remediation is available by upgrading affected packages to version 1.16.5.
GHSA-r95h-9x8f-r3f7 at a Glance
How to Fix GHSA-r95h-9x8f-r3f7
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.16.5
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-r95h-9x8f-r3f7, 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.16.5), 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-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow'), where the product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. 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-r95h-9x8f-r3f7 Affected Nokogiri Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nokogiri
|
RubyGems |
< 1.16.5
|
1.16.5
|
References
Frequently Asked Questions
What is GHSA-r95h-9x8f-r3f7?
Which Nokogiri versions are affected?
What version fixes GHSA-r95h-9x8f-r3f7?
Is nokogiri affected?
What CWE is associated with GHSA-r95h-9x8f-r3f7?
How can I check RubyGems dependencies for GHSA-r95h-9x8f-r3f7?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r95h-9x8f-r3f7",
"modified" : "2024-05-15T19:27:10Z",
"published" : "2024-05-13T16:05:42Z",
"aliases" : [ ],
"summary" : "Nokogiri updates packaged libxml2 to v2.12.7 to resolve CVE-2024-34459",
"details" : "## Summary\n\nNokogiri v1.16.5 upgrades its dependency libxml2 to [2.12.7](https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.7) from 2.12.6.\n\nlibxml2 v2.12.7 addresses CVE-2024-34459:\n\n- described at https://gitlab.gnome.org/GNOME/libxml2/-/issues/720\n- patched by https://gitlab.gnome.org/GNOME/libxml2/-/commit/2876ac53\n\n\n## Impact\n\nThere is no impact to Nokogiri users because the issue is present only in libxml2's `xmllint` tool which Nokogiri does not provide or expose.\n\n\n## Timeline\n\n- 2024-05-13 05:57 EDT, libxml2 2.12.7 release is announced\n- 2024-05-13 08:30 EDT, nokogiri maintainers begin triage\n- 2024-05-13 10:05 EDT, nokogiri [v1.16.5 is released](https://github.com/sparklemotion/nokogiri/releases/tag/v1.16.5) and this GHSA made public",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "nokogiri"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.16.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-r95h-9x8f-r3f7"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/GHSA-r95h-9x8f-r3f7.yml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sparklemotion/nokogiri"
}, {
"type" : "WEB",
"url" : "https://github.com/sparklemotion/nokogiri/releases/tag/v1.16.5"
}, {
"type" : "WEB",
"url" : "https://gitlab.gnome.org/GNOME/libxml2/-/commit/2876ac53"
}, {
"type" : "WEB",
"url" : "https://gitlab.gnome.org/GNOME/libxml2/-/issues/720"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-120" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-13T16:05:42Z",
"nvd_published_at" : null
}
}