code-423n4 / loopfi-bug-bounty

5 stars 6 forks source link

Lack of validate `minBuyAmount` in `calldata` can cause lost protocol funds #28

Closed c4-bot-3 closed 3 months ago

c4-bot-3 commented 4 months ago

Lines of code

https://github.com/LoopFi/loop-prelaunch-contracts/blob/c8b13474aa4f319eec368fc4827bf51eddad080f/src/PrelaunchPoints.sol#L263 https://github.com/LoopFi/loop-prelaunch-contracts/blob/c8b13474aa4f319eec368fc4827bf51eddad080f/src/PrelaunchPoints.sol#L424 https://github.com/LoopFi/loop-prelaunch-contracts/blob/c8b13474aa4f319eec368fc4827bf51eddad080f/src/PrelaunchPoints.sol#L461

Vulnerability details

The returned values ​​from decoding call data should always be checked, one of important which is minBuyAmount, which is used for slippage, and this should be checked the the task of validate the returned data. _validateData function does not validate the value of minBuyAmount:

c4-bot-10 commented 4 months ago

Discord id(s) for hunter(s): [object Object]

bytes032 commented 3 months ago

Invalid + Lacks POC