Closed code423n4 closed 1 year ago
JeffCX marked the issue as primary issue
JeffCX marked the issue as high quality report
The reports shows how direct transfer of token can impact liquidity pool with coded POC so the report deserves sponsor's review
tkkwon1998 marked the issue as sponsor confirmed
External users can swap on this dex in addition to onboarding users, meaning if someone sends 100 eth into a pool with low amounts of canto, other users will buy canto on other dexs and sell into this dex for an extremely inflated price. The attacker would lose money due to this arb.
tkkwon1998 marked the issue as sponsor disputed
In general, AMM's are able to have their price manipulated by a single actor. If users then interact with those pools without understanding the current price, they will lose money.
The single actor is of course exposed to market forces making this strategy unlikely. They are much more likely to lose money than they are to trick users into swapping at bad prices.
I don't see this as novel to this AMM, even though the setup is slightly unique to set up the attack.
Downgrading to QA
0xean changed the severity to QA (Quality Assurance)
0xean marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2023-06-canto/blob/a4ff2fd2e67e77e36528fad99f9d88149a5e8532/Canto/x/coinswap/keeper/keeper.go#LL138-L149 https://github.com/code-423n4/2023-06-canto/blob/main/Canto/x/coinswap/keeper/swap.go#LL131 https://github.com/code-423n4/2023-06-canto/blob/a4ff2fd2e67e77e36528fad99f9d88149a5e8532/Canto/x/coinswap/keeper/pool.go#L79
Vulnerability details
Several points are highlighted by the PoC, however, I've submitted these in a single report because they are exploitable together:
Impact
An attacker who acts early enough can circumvent the limits in place, effectively taking over the liquidity pool, manipulating the swap price, and making a profit from automated onboarding swaps.
Proof of Concept
Tools Used
Visual code inspection
Recommended Mitigation Steps
Assessed type
Token-Transfer