Skip to content

Commit

Permalink
Add disclosure for hasbrown's borsh encoding (#2100)
Browse files Browse the repository at this point in the history
* Add disclosure for hasbrown's borsh encoding

* Remove when hashbrown was patched

It's unclear with what version it will be and when it will be. I'd prefer to make this valid and file-able now than risk someone starting to use this functionality (which will make removing it more complicated).

* Update RUSTSEC-0000-0000.md

* Be more specific regarding affected
  • Loading branch information
kayabaNerve authored Dec 4, 2024
1 parent 7c294ea commit 3cb0a91
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions crates/hashbrown/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "hashbrown"
date = "2024-10-11"
url = "https://github.com/rust-lang/hashbrown/issues/576"
categories = []
keywords = ["borsh"]

[versions]
patched = [">= 0.15.1"]
unaffected = ["<= 0.14"]

[affected]
functions = { "hashbrown::HashMap::borsh_serialize" = ["=0.15.0"] }
```

# Borsh serialization of HashMap is non-canonical

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.

0 comments on commit 3cb0a91

Please sign in to comment.