Closed code423n4 closed 1 year ago
If Alice thinks she would be the first to supply she would set the minLPTokenAmount
parameter to sqrt(100*100)=100
(because she expects 0 slippage) which would cause her tx to revert
berndartmueller marked the issue as duplicate of #442
berndartmueller marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2022-12-caviar/blob/0212f9dc3b6a418803dbfacda0e340e059b8aae2/src/Pair.sol#L63-L99 https://github.com/code-423n4/2022-12-caviar/blob/0212f9dc3b6a418803dbfacda0e340e059b8aae2/src/Pair.sol#L417-L427
Vulnerability details
Impact
Creation of the pair does not add initial liquidity which leads to situation where attacker can front-run creator and execute sandwich attack against the creator.
Exploitation Scenario:
Proof of Concept
Pair.sol
:Tools Used
Manual Review
Recommended Mitigation Steps
It is recommended to initialize pair with the liquidity provided by the creator.