GitHub Advisoryadvisory · crates.io

GHSA-wwq9-3cpr-mm53 Borsh serialization of HashMap is non-canonical

HIGH Published 2024-12-04 Modified 2024-12-04 Official page ↗
Ecosystem
crates.io
Packages
hashbrown
Severity
High
CVSS vector
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
Weaknesses
CWE-502
Reviewed
2024-12-04

Affected packages

• crates.io hashbrown: >= 0.15.0, < 0.15.1 → fixed in 0.15.1

Description

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.

Related

Weakness · CWE (1)

  • CWE-502 Deserialization of Untrusted Data weakness

References