Detailed description of the impact of this finding.
The addQuote function in the pair.sol smart contract utilizes a pricing formula for liquidity pools that is susceptible to exploitation through flashloan manipulation. By introducing a large quantity of the basetoken into the underlying pool, an attacker can artificially inflate the value of the liquidity pool tokens, enabling them to acquire an excess amount and drain the pool.
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
Lines of code
https://github.com/code-423n4/2022-12-caviar/blob/0212f9dc3b6a418803dbfacda0e340e059b8aae2/src/Pair.sol#L417
Vulnerability details
Impact
Detailed description of the impact of this finding.
The addQuote function in the pair.sol smart contract utilizes a pricing formula for liquidity pools that is susceptible to exploitation through flashloan manipulation. By introducing a large quantity of the basetoken into the underlying pool, an attacker can artificially inflate the value of the liquidity pool tokens, enabling them to acquire an excess amount and drain the pool.
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
https://github.com/code-423n4/2022-12-caviar/blob/0212f9dc3b6a418803dbfacda0e340e059b8aae2/src/Pair.sol#L417
Tools Used
Manual Review
Recommended Mitigation Steps