CVE-2025-6490: Nokogiri Sparklemotion Nokogiri Hashmap.c Hashmap_set_with_hash Heap-based Vulnerability

LOW
Advisory Identifier: GHSA-pf9w-gvcf-gv7m
CVSS 3.3
CWE-119
Published
Advisory Summary

CVE-2025-6490 is a LOW (CVSS 3.3) sparklemotion nokogiri hashmap.c hashmap_set_with_hash heap-based vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Nokogiri libraries in the RubyGems ecosystem. The issue involves sparklemotion nokogiri hashmap.c hashmap_set_with_hash heap-based overflow. Remediation is available in the latest vendor maintenance releases.

CVE-2025-6490 at a Glance

CVE Identifier CVE-2025-6490
GHSA Identifier GHSA-pf9w-gvcf-gv7m
Severity LOW
CVSS v3.1 Base Score 3.3
CWE Classification CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
Affected Product Nokogiri
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 3.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2025-6490

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: Latest secure release
Upgrade nokogiri to Latest secure release
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 CVE-2025-6490, 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 the patched release), 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-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. 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

### Withdrawn Advisory This advisory has been withdrawn because the affected code was never included in a release. This link has been maintained to preserve external references. ### Original Description A vulnerability was found in sparklemotion nokogiri c29c920907366cb74af13b4dc2230e9c9e23b833 and classified as problematic. This issue affects the function hashmap_set_with_hash of the file gumbo-parser/src/hashmap.c. The manipulation leads to heap-based buffer overflow. An attack has to be approached locally. The exploit has been disclosed to the public and may be used. The real existence of this vulnerability is still doubted at the moment. The identifier of the patch is ada4708e5a67114402cd3feb70a4e1d1d7cf773a. It is recommended to apply a patch to fix this issue. The project maintainer explains that the affected code was merged into the main branch but the commit never appeared in an official release.

CVE-2025-6490 Affected Nokogiri Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
nokogiri
RubyGems
0
All 1 versions
0
None specified

References

Frequently Asked Questions

What is CVE-2025-6490?
CVE-2025-6490 is a security vulnerability in Nokogiri involving sparklemotion nokogiri hashmap.c hashmap_set_with_hash heap-based overflow under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer.
Which Nokogiri versions are affected?
Affected versions include releases prior to current release patches across affected packages: nokogiri.
What version fixes CVE-2025-6490?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is nokogiri affected?
Yes, nokogiri is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2025-6490?
CVE-2025-6490 has a CVSS v3.1 base score of 3.3 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2025-6490?
CVE-2025-6490 is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer (The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.).
How can I check RubyGems dependencies for CVE-2025-6490?
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-pf9w-gvcf-gv7m",
  "modified" : "2025-06-30T21:44:21Z",
  "published" : "2025-06-22T21:30:27Z",
  "withdrawn" : "2025-06-30T20:45:04Z",
  "aliases" : [ "CVE-2025-6490" ],
  "summary" : "sparklemotion nokogiri hashmap.c hashmap_set_with_hash heap-based overflow",
  "details" : "### Withdrawn Advisory\n\nThis advisory has been withdrawn because the affected code was never included in a release. This link has been maintained to preserve external references.\n\n### Original Description\n\nA vulnerability was found in sparklemotion nokogiri c29c920907366cb74af13b4dc2230e9c9e23b833 and classified as problematic. This issue affects the function hashmap_set_with_hash of the file gumbo-parser/src/hashmap.c. The manipulation leads to heap-based buffer overflow. An attack has to be approached locally. The exploit has been disclosed to the public and may be used. The real existence of this vulnerability is still doubted at the moment. The identifier of the patch is ada4708e5a67114402cd3feb70a4e1d1d7cf773a. It is recommended to apply a patch to fix this issue. The project maintainer explains that the affected code was merged into the main branch but the commit never appeared in an official release.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "nokogiri"
    },
    "versions" : [ "0" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-6490"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/nokogiri/issues/3500"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/nokogiri/pull/3524"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sparklemotion/nokogiri/commit/ada4708e5a67114402cd3feb70a4e1d1d7cf773a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sparklemotion/nokogiri"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/user-attachments/files/19625432/nokogiri_crash.txt"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.313601"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.313601"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?submit.601005"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-119" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-30T20:45:04Z",
    "nvd_published_at" : "2025-06-22T19:15:20Z"
  }
}