Borsh serialization of HashMap is non-canonical
High severity
GitHub Reviewed
Published
Dec 4, 2024
to the GitHub Advisory Database
•
Updated Dec 4, 2024
Description
Published to the GitHub Advisory Database
Dec 4, 2024
Reviewed
Dec 4, 2024
Last updated
Dec 4, 2024
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.
References