MsgSwapOrder will never work for Canto nodes
The MsgSwapOrder message lacks a signer annotation, so Canto nodes cannot identify who signed it and the message never works. This prevents arbitrage that would balance pool prices, potentially causing the onboarding swap to fail its slippage check.
Submitted by 0x1771, also found by 3docSec
An oversight in the MsgSwapOrder where the tag is directed to nested. The input message lacks the necessary cosmos.msg.v1.signer to indirectly identify the signer.
message Input {
string address = 1;
cosmos.base.v1beta1.Coin coin = 2 [ (gogoproto.nullable) = false ];
}
Recommended Mitigation Steps
Add DefineCustomGetSigners call in app.go for the coinswap Input message like you did for MsgConvertERC20.
signingOptions.DefineCustomGetSigners(protov2.MessageName(&erc20v1.MsgConvertERC20{}), erc20types.GetSignersFromMsgConvertERC20V2)
poorphd (Canto) confirmed and commented:
Reasoning: The liquidity pools used for onboarding are directly called by the keeper method in the IBC middleware, so there is no problem with the onboarding function because the swap occurs. However, since only the swap from the ibc voucher to canto takes place, if there is a price discrepancy, a mechanism is needed for the arbitrager to return to the appropriate price through MsgSwapOrder.
Severity:
Mid→QA.In order to abuse this for price manipulation, it is necessary to repeatedly make auto-swaps through IBC transfers, but the auto-swap function only works when the balance of canto is less than 4, making it difficult to manipulate prices. This issue is valid, but since it is not an issue that opposes the real risk of assets, the severity should be adjusted from
MidtoQA.Patch: We will patch this before the v0.50 production release.
As the sponsor said, the effect of this vulnerability is that the pools’ price drifts won’t be balanced by a necessary arbitraging force which is required for the swap to meet the slippage/
maxSwapAmountcheck; hence, impacting the availability of the Onboarding functionality. For this reason, I find Medium an appropriate severity for this finding.
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
What the attacker needed
Canto node running the affected code; IBC onboarding swap in use
The fix
The sponsor said they will patch it before the v0.50 production release, for example by registering a custom signer resolver for the coinswap Input message.
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 this blockchain, a message must tell the node which field holds the address of the person who signed it. The swap-order message forgot to do that, so the node cannot verify the signature and rejects the message. As a result, a needed price-balancing action cannot 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.