Closed c4-bot-6 closed 10 months ago
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as duplicate of #13
alcueca marked the issue as unsatisfactory: Invalid
alcueca marked the issue as unsatisfactory: Invalid
alcueca marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-01-curves/blob/main/contracts/Curves.sol#L282-L293
Vulnerability details
Impact
Users have no slippage control or protection on sells. Therefore, they cannot prevent a malicious user who owns the same token from selling a massive amount of tokens (tx1) before their sell tx executes (tx2), causing them to receive much less ETH than expected. The same malicious user can then buy their tokens back at a reduced cost (tx3) after the first two transactions execute within the same block.
Proof of Concept
sellCurvesToken
expecting a certain amount of ETH in return.sellCurvesToken
tx of their own with higher gas than user A.Tools Used
Manual review
Recommended Mitigation Steps
Along with the typical "run a private mempool" which may not be very practical, some more interesting options are:
Assessed type
Other