code-423n4 / 2022-12-caviar-findings

2 stars 1 forks source link

LP token is vulnerable to flashloan manipulation #497

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

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

Shungy commented 1 year ago

Seems invalid.

By introducing a large quantity of the basetoken into the underlying pool,

You mean by gifting them :smile:

c4-judge commented 1 year ago

berndartmueller marked the issue as unsatisfactory: Insufficient proof