Closed code423n4 closed 1 year ago
AutoSwapThreshold is a parameter that can be modified through governance. If the price of canto changes drastically, this param will be adjusted accordingly. Although having a dynamically adjusting swap threshold would be a good solution, it would likely require some kind of oracle which increases complexities and failure points.
tkkwon1998 marked the issue as sponsor disputed
0xean changed the severity to QA (Quality Assurance)
0xean marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2023-06-canto/blob/a4ff2fd2e67e77e36528fad99f9d88149a5e8532/Canto/x/onboarding/keeper/ibc_callbacks.go#L92
Vulnerability details
Impact
If Canto price reaches a large amount, small swaps will always revert.
Proof of Concept
This is the current user flow to onboard users into the Canto network:
User Flow
Right now, Canto is worth $0.11 USDC, which is pretty affordable to swap. However, if it reach an exorbitant amount of price (like ETH price for example), then users will not have enough funds to reach the threshold of 4 Canto in their wallets, which may force all swaps to swap to Canto first. If the swap amount is lesser than 4 Canto worth, then the swap will fail, and it may affect many people trying to swap small amounts into the Canto network.
Tools Used
Manual Review
Recommended Mitigation Steps
Recommending setting AutoSwapThreshold to a dynamic integer, in case 4 Canto gets too expensive.
Assessed type
Other