Govshuttle module does not register it messages to LegacyAminoCodec #9
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-29
ineligible for award
🤖_primary
AI based primary recommendation
🤖_05_group
AI based duplicate group recommendation
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-05-canto/blob/d1d51b2293d4689f467b8b1c82bba84f8f7ea008/canto-main/x/govshuttle/module.go#L53
Vulnerability details
The GovShuttle implements the
AppModuleBasic
interface by implementing its methods.Among these, the
RegisterLegacyAminoCodec
has an incorrect implementation (canto-main/x/govshuttle/module.go
):In the
(AppModuleBasic) RegisterLegacyAminoCodec
function we can see that the Govshuttle module calls thetypes.RegisterCodec(cdc)
function that does nothing:
This means that the
cdc.RegisterConcrete
calls that other modules make, aren't made for the messages directed to theGovshuttle module, so these types won't be properly decoded when signed with the LegacyAmino codec.
Impact
Messages to the Govshuttle module will fail when signed with the legacy Amino method
Proof of Concept
To prove this issue it is sufficient to send any message signed with the Legacy Amino method to the GovShuttle module
Tools Used
Code review
Recommended Mitigation Steps
Consider modifying the
RegisterLegacyAminoCodec
function as follows:The
AppModuleBasic
RegisterCodec
function can also be removed as it has no caller.Assessed type
Other
The text was updated successfully, but these errors were encountered: