near / borsh

Binary Object Representation Serializer for Hashing
https://borsh.io/
487 stars 41 forks source link

Fix BorshDeserialize for bool and Option #52

Closed mikhailOK closed 4 years ago

mikhailOK commented 4 years ago

BorshDeserialize for bool and Option accepts arbitrary values where it should only allow 0 or 1. This makes it possible for an object to have multiple representations which can potentially allow attacks on our usage of borsh.

lexfrl commented 4 years ago

fixed now

https://github.com/nearprotocol/borsh/blob/master/borsh-rs/borsh/src/de/mod.rs#L83-L123