console icon indicating copy to clipboard operation
console copied to clipboard

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

Open github-actions[bot] opened this issue 11 months ago • 1 comments

Borsh serialization of HashMap is non-canonical

Details
Package hashbrown
Version 0.15.0
URL https://github.com/rust-lang/hashbrown/issues/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.

github-actions[bot] avatar Dec 05 '24 00:12 github-actions[bot]

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.

0xPoe avatar Dec 11 '24 13:12 0xPoe