Skip to content
Business logic Audit finding Intermediate

Govshuttle module does not register its transaction MsgServer

The govshuttle module did not register its message server, so governance proposals containing LendingMarketProposal or TreasuryProposal messages would fail to execute. An attacker could not exploit this directly, but legitimate governance actions would be ineffective.

3docSec Follow

Originally disclosed on Code4rena

Submitted by 3docSec

The x/govshuttle module in canto-main defines and handles two messages that can be emitted by a governance proposal:

However, because the module only registers the QueryServer (and not its MsgServer) in its RegisterServices function, causing no message to be routed to its message server:

func (am AppModule) RegisterServices(cfg module.Configurator) {
	types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
}

If we compare this with another module that can handle messages, for example, CSR, we see that this is the place for registering the MsgServer where transactional messages are routed to:

func (am AppModule) RegisterServices(cfg module.Configurator) {
	types.RegisterMsgServer(cfg.MsgServer(), am.keeper)
	types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
}

Impact

Successful governance actions that include a LendingMarketProposal or TreasuryProposal will fail to execute because no handler is provided for them.

Proof of Concept

To reproduce the issue it is sufficient to create and approve a proposal among the affected ones.

Recommended Mitigation Steps

Consider adding a RegisterMsgServer call in the x/govshuttle RegisterService callback.

dudong2 (Canto) confirmed and commented:

Reasoning: As your description, the MsgServer isn’t not registered about govshuttle module. Even if gov proposal that include a LendingMarketProposal or TreasuryProposal is passed, the msgs are not executed because there is no handler registered.

Severity: Mid.

Patch: We will patch this before the v0.50 production release.


The original report as published on Code4rena, by 3docSec. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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 module's RegisterServices function only registered the query server, not the message server, so incoming messages were not routed to the handler.

What the attacker needed

A governance proposal with affected message; proposal must be approved

The fix

The module should register its message server in the RegisterServices function, and the project confirmed they will patch it before the v0.50 production release.

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 blockchain systems, modules handle different types of transactions. This module was supposed to process two kinds of governance proposals but forgot to connect the part that actually executes them. As a result, even if a proposal passed, nothing would happen.

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.

More by 3docSec

View all

15 more disclosed reports, best first.

More from Canto

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.