Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disclosure for hasbrown's borsh encoding #2100

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how this is supposed to be interpreted, but at least cargo-deny flags 0.14.5 as being affected now. Maybe unaffected = ["< 0.15.0"] would be better?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened #2157 with that proposal


[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.