GHSA-wwq9-3cpr-mm53: Hashbrown Borsh Serialization Of HashMap Is Vulnerability

HIGH
CWE-502
Published
Advisory Summary

GHSA-wwq9-3cpr-mm53 is a HIGH borsh serialization of hashmap is vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Hashbrown libraries in the crates.io ecosystem. The issue involves borsh serialization of hashmap is non-canonical. Remediation is available by upgrading affected packages to version 0.15.1.

GHSA-wwq9-3cpr-mm53 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-wwq9-3cpr-mm53
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Hashbrown
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-wwq9-3cpr-mm53

To remediate this vulnerability, upgrade all affected Hashbrown dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

hashbrown fixed: 0.15.1
Upgrade hashbrown to 0.15.1
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 hashbrown

How to Check if You Are Affected

To determine whether your application is affected by GHSA-wwq9-3cpr-mm53, inspect your project dependencies for Hashbrown:

inspect dependencies for hashbrown

Analyze the terminal output to locate any version of Hashbrown in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.15.1), 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Hashbrown, 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

The borsh serialization of the HashMap did not follow the borsh specification. It potentially produced non-canonical encodings dependent on insertion order. It also did not perform canonicty checks on decoding. This can result in consensus splits and cause equivalent objects to be considered distinct. This was patched in 0.15.1.

GHSA-wwq9-3cpr-mm53 Affected Hashbrown Versions

1 component(s)
Fixed Versions:
0.15.1
Product / Package Ecosystem Affected Versions Fixed Version
hashbrown
crates.io
≥ 0.15.0
< 0.15.1
0.15.1

References

Frequently Asked Questions

What is GHSA-wwq9-3cpr-mm53?
GHSA-wwq9-3cpr-mm53 is a security vulnerability in Hashbrown involving Borsh serialization of HashMap is non-canonical under CWE-502: Deserialization of Untrusted Data.
Which Hashbrown versions are affected?
Affected versions include releases prior to 0.15.1 across affected packages: hashbrown.
What version fixes GHSA-wwq9-3cpr-mm53?
Upgrading to 0.15.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hashbrown affected?
Yes, hashbrown is affected in releases prior to 0.15.1. Upgrade your dependency to 0.15.1 or later.
What CWE is associated with GHSA-wwq9-3cpr-mm53?
GHSA-wwq9-3cpr-mm53 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check crates.io dependencies for GHSA-wwq9-3cpr-mm53?
Run the dependency tree command: 'inspect dependencies for hashbrown'. 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-wwq9-3cpr-mm53",
  "modified" : "2024-12-04T18:29:15Z",
  "published" : "2024-12-04T18:29:15Z",
  "aliases" : [ ],
  "summary" : "Borsh serialization of HashMap is non-canonical",
  "details" : "The borsh serialization of the HashMap did not follow the borsh specification. It potentially produced non-canonical encodings dependent on insertion order. It also did not perform canonicty checks on decoding.\n\nThis can result in consensus splits and cause equivalent objects to be considered distinct.\n\nThis was patched in 0.15.1.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "hashbrown"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.15.0"
      }, {
        "fixed" : "0.15.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rust-lang/hashbrown/issues/576"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kayabaNerve/hashbrown-borsh-poc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rust-lang/hashbrown"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0402.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-04T18:29:15Z",
    "nvd_published_at" : null
  }
}