coinswap pool price manipulation #7
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-13
grade-b
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_primary
AI based primary recommendation
🤖_02_group
AI based duplicate group recommendation
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-05-canto/blob/d1d51b2293d4689f467b8b1c82bba84f8f7ea008/canto-main/x/coinswap/keeper/keeper.go#L253
Vulnerability details
Impact
price manipulation
Proof of Concept
AddLiquidity
prevents price manipulation by settingMinLiquidity
:Unfortunately,
RemoveLiquidity
invalidates this limit.RemoveLiquidity
only limits the minimum amount of Withdraw tokens,Without checking the amount of liquidity remaining in the pool,
After adding liquidity, the attacker can remove most of the liquidity, and then keep a small amount of liquidity in the pool, by donating tokens to the pool, to manipulate the price of the token pair.
Tools Used
vscode, manual
Recommended Mitigation Steps
Check the amount of liquidity remaining in the pool when removing liquidity
Assessed type
Other
The text was updated successfully, but these errors were encountered: