Add/remove authorization messages are not usable due to missing registration
The AddAuthorization and RemoveAuthorization message types were not registered in the codec, so transactions using them could not be decoded or routed. This made these messages completely unusable.
Source: https://github.com/sherlock-audit/2025-04-zetachain-cross-chain-judging/issues/89
Found by
0xAlix2
Summary
In Cosmos SDK modules, codec.go is responsible for registering all message and interface types with both the Amino codec and the Protobuf interface registry. Every module message must be registered in both RegisterInterfaces and RegisterCodec (if legacy Amino support is required). This registration enables the Cosmos SDK to correctly decode incoming messages and route them to the appropriate MsgServer handlers.
The node/x/authority module defines five message handlers in its MsgServer: UpdatePolicies, UpdateChainInfo, RemoveChainInfo, AddAuthorization, and RemoveAuthorization. However, the AddAuthorization and RemoveAuthorization messages are missing from both RegisterInterfaces and RegisterCodec.
As a result, these messages are unusable.
func RegisterCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgUpdatePolicies{}, "authority/UpdatePolicies", nil)
cdc.RegisterConcrete(&MsgUpdateChainInfo{}, "authority/UpdateChainInfo", nil)
cdc.RegisterConcrete(&MsgRemoveChainInfo{}, "authority/RemoveChainInfo", nil)
}
func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgUpdatePolicies{},
&MsgUpdateChainInfo{},
&MsgRemoveChainInfo{},
)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
Root Cause
The AddAuthorization and RemoveAuthorization message types are missing from both registration functions in codec.go.
Internal Pre-conditions
N/A
External Pre-conditions
N/A
Attack Path
N/A
Impact
Any transaction attempting to call MsgAddAuthorization or MsgRemoveAuthorization will fail to be decoded or routed, rendering these messages completely unusable via CLI, gRPC, or transactions.
Proof of Concept
N/A
Mitigation
Add the missing message types to RegisterCodec and RegisterInterfaces in node/x/authority/types/codec.go:
func RegisterCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgUpdatePolicies{}, "authority/UpdatePolicies", nil)
cdc.RegisterConcrete(&MsgUpdateChainInfo{}, "authority/UpdateChainInfo", nil)
cdc.RegisterConcrete(&MsgRemoveChainInfo{}, "authority/RemoveChainInfo", nil)
+ cdc.RegisterConcrete(&MsgAddAuthorization{}, "authority/AddAuthorization", nil)
+ cdc.RegisterConcrete(&MsgRemoveAuthorization{}, "authority/RemoveAuthorization", nil)
}
func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgUpdatePolicies{},
&MsgUpdateChainInfo{},
&MsgRemoveChainInfo{},
+ &MsgAddAuthorization{},
+ &MsgRemoveAuthorization{},
)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
This ensures the messages can be decoded, routed, and executed properly within the Cosmos SDK framework.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/zeta-chain/node/pull/3959
gjaldon
Added the missing codecs to RegisterCodec() and RegisterInterfaces().
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The AddAuthorization and RemoveAuthorization message types were missing from both RegisterInterfaces and RegisterCodec in codec.go.
Impact
Any transaction attempting to call MsgAddAuthorization or MsgRemoveAuthorization will fail to be decoded or routed, rendering these messages completely unusable via CLI, gRPC, or transactions.
What the attacker needed
None
The fix
The missing message types were added to RegisterCodec and RegisterInterfaces, and the protocol team fixed the issue.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In some blockchain frameworks, every type of transaction must be registered so the system knows how to read it. Here, two transaction types were left out of that list, so they could not be processed at all.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.