GHSA-r95h-9x8f-r3f7: Nokogiri Nokogiri Updates Packaged Libxml2 To Vulnerability

LOW
CWE-120
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-r95h-9x8f-r3f7
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Affected Product Nokogiri
Package Ecosystem RubyGems
Published Date
Last Updated

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.

nokogiri fixed: 1.16.5
Upgrade nokogiri to 1.16.5
Verify Direct and Transitive Dependencies

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

## Summary Nokogiri 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. libxml2 v2.12.7 addresses CVE-2024-34459: - described at https://gitlab.gnome.org/GNOME/libxml2/-/issues/720 - patched by https://gitlab.gnome.org/GNOME/libxml2/-/commit/2876ac53 ## Impact There is no impact to Nokogiri users because the issue is present only in libxml2's `xmllint` tool which Nokogiri does not provide or expose. ## Timeline - 2024-05-13 05:57 EDT, libxml2 2.12.7 release is announced - 2024-05-13 08:30 EDT, nokogiri maintainers begin triage - 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

GHSA-r95h-9x8f-r3f7 Affected Nokogiri Versions

1 component(s)
Fixed Versions:
1.16.5
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?
GHSA-r95h-9x8f-r3f7 is a security vulnerability in Nokogiri involving Nokogiri updates packaged libxml2 to v2.12.7 to resolve CVE-2024-34459 under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow').
Which Nokogiri versions are affected?
Affected versions include releases prior to 1.16.5 across affected packages: nokogiri.
What version fixes GHSA-r95h-9x8f-r3f7?
Upgrading to 1.16.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nokogiri affected?
Yes, nokogiri is affected in releases prior to 1.16.5. Upgrade your dependency to 1.16.5 or later.
What CWE is associated with GHSA-r95h-9x8f-r3f7?
GHSA-r95h-9x8f-r3f7 is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') (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.).
How can I check RubyGems dependencies for GHSA-r95h-9x8f-r3f7?
Run the dependency tree command: 'inspect dependencies for nokogiri'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}