Submitted by 3docSec
One of the breaking changes introduced with the Cosmos SDK v0.50.x upgrade is a change in the codec used for Amino JSON
(de)serialization. To ensure the
new codec behaves as the abandoned one did, the team added amino.name tags to the message types defined in the Canto
modules .proto files.
There are however many instances where these tags are inconsistent with the RegisterConcrete calls made by the
in-scope modules func (AppModuleBasic) RegisterInterfaces functions, all summarized below:
Module coinswap:
Module csr:
Module erc20:
Module govshuttle:
Module govshuttle has no discrepancy thanks to the fact that the RegisterConcrete call was not made with the Msg types
Module inflation:
Module onboarding:
Module evm:
Module feemarket:
All the messages with inconsistent settings listed above, when signed with the LegacyAmino method on a v7 or compatible client, will not be recognized (and consequently rejected) by the Canto app v8 message routing.
This finding can be proved by adapting this generative test
(that is the verification tool mentioned in the Cosmos SDK v0.50.x upgrade guide)
to check the messages defined in the Canto modules instead of those standard to the Cosmos SDK it was originally
written for.
Adapting this test requires a bit of workarounds because the test itself uses internal packages of the Canto SDK that
cant be imported directly, so to make a runnable PoC, Ive created a Bash script that builds up the test environment,
and runs the failing test (note that Git and Go installations are a prerequisite for this script).
This Bash script can be found here and its output (limited to the first of 14 failing tests) is:
Consider fixing the RegisterConcrete calls to match the amino.name flags of all the messages enumerated above, which fail the test provided as PoC.
en/de-code
dudong2 (Canto) confirmed and commented:
For this audit, 11 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by Dup1337 received the top score from the judge.
The following wardens also submitted reports: forgebyola, ladboy233, ABAIKUNANBAEV, 0xSergeantPepper, Ocean_Sky, 0x1771, honeymewn, carrotsmuggler, 3docSec, and zhaojie.
