You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Either serialisation format should change or deserialisation should verify the object is valid.
IMO ideally ChainId would be serialised as a String without the revision_number and the revision would be filled in when deserialising. Alas, this would be an ABI breaking change.
ABI-stable alternative is for deserialise implementations to verify that the parsed object is correct.
(Side note: IMO revision_number shouldn’t even be a field in ChainId and instead it should be parsed when requested but that’s a separate matter).
Version
ibc-core-host-types = { version = "0.48.1", features = ["serde", "borsh"] }
The text was updated successfully, but these errors were encountered:
Awesome info @mina86! Thanks for flagging this. We'll dive into it and figure out the best way to tackle the situation.
I have a hunch that it might be the case for other identifiers too.
With other identifiers the problem is that deserialisation will accept
arbitrary strings even if they contain invalid characters or are invalid
length. It's also an issue but subtly different one.
Bug Summary
It’s possible to craft JSON or Borsh serialised object which deserialises into an inconsistent ChainId object which has invalid revision_number field.
Demonstration
Solution
Either serialisation format should change or deserialisation should verify the object is valid.
IMO ideally ChainId would be serialised as a String without the revision_number and the revision would be filled in when deserialising. Alas, this would be an ABI breaking change.
ABI-stable alternative is for deserialise implementations to verify that the parsed object is correct.
(Side note: IMO revision_number shouldn’t even be a field in ChainId and instead it should be parsed when requested but that’s a separate matter).
Version
The text was updated successfully, but these errors were encountered: