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

RUSTSEC-2024-0402: Borsh serialization of HashMap is non-canonical #600

Open
github-actions bot opened this issue Dec 5, 2024 · 1 comment
Open
Assignees
Labels
rust Pull requests that update Rust code S-bug Severity: bug

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2024

Borsh serialization of HashMap is non-canonical

Details
Package hashbrown
Version 0.15.0
URL rust-lang/hashbrown#576
Date 2024-10-11
Patched versions >=0.15.1
Unaffected versions <0.15.0

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.

See advisory page for additional details.

@Rustin170506 Rustin170506 added S-bug Severity: bug rust Pull requests that update Rust code labels Dec 11, 2024
@Rustin170506
Copy link
Collaborator

This one is a little bit difficult to fix now because we have two versions of hashbrown in our dependency tree.

cargo tree --invert -p hashbrown 
error: There are multiple `hashbrown` packages in your project, and the specification `hashbrown` is ambiguous.
Please re-run this command with one of the following specifications:
  [email protected]
  [email protected]

console on  main [$⇡] via 🦀 v1.83.0 cargo tree --invert -p [email protected]
hashbrown v0.12.3
└── indexmap v1.9.3
    └── tower v0.4.13
        ├── tokio-console v0.1.13 (/Volumes/t7/code/console/tokio-console)
        └── tonic v0.12.3
            ├── console-api v0.8.1 (/Volumes/t7/code/console/console-api)
            │   ├── console-subscriber v0.4.1 (/Volumes/t7/code/console/console-subscriber)
            │   └── tokio-console v0.1.13 (/Volumes/t7/code/console/tokio-console)
            ├── console-subscriber v0.4.1 (/Volumes/t7/code/console/console-subscriber)
            └── tokio-console v0.1.13 (/Volumes/t7/code/console/tokio-console)
        [dev-dependencies]
        └── console-subscriber v0.4.1 (/Volumes/t7/code/console/console-subscriber)

We need to wait for the tower to update their dependency first; then we can bump the tower to fix these issues.

@Rustin170506 Rustin170506 self-assigned this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust Pull requests that update Rust code S-bug Severity: bug
Projects
None yet
Development

No branches or pull requests

1 participant