# GHSA-WWQ9-3CPR-MM53: Borsh serialization of HashMap is non-canonical

- Database: GitHub
- Severity: high (stated by ghsa, no CVSS score)
- Published: 2024-12-04
- Modified: 2026-09-10

## Also published as

- [RUSTSEC-2024-0402](https://cve.now/RUSTSEC-2024-0402.md) (RustSec)

## Affected versions

- hashbrown (crates.io): from 0.15.0, 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.

## References

- https://github.com/rust-lang/hashbrown/issues/576
- https://github.com/kayabaNerve/hashbrown-borsh-poc
- https://github.com/rust-lang/hashbrown
- https://rustsec.org/advisories/RUSTSEC-2024-0402.html

Page: https://cve.now/GHSA-WWQ9-3CPR-MM53

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
