Add disclosure for hasbrown's borsh encoding (#2100)

* 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
This commit is contained in:
Luke Parker
2024-12-04 12:19:43 +00:00
committed by GitHub
parent 7c294ea340
commit 3cb0a91f7a
+27
View File
@@ -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.