This repository has been archived by the owner on May 26, 2023. It is now read-only.
banditx0x - Users That Deposit Into Ichi Spell Can be Unfairly Liquidated by Attacker #334
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
High
A valid High severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
banditx0x
high
Users That Deposit Into Ichi Spell Can be Unfairly Liquidated by Attacker
Summary
Ichi Spell does not use a Chainlink or TWAP oracle for liquidity positons, but rather the token price in the Uniswap v3 Pool. An attacker can liquidate other users with flashloans and/or swaps on the Uniswap v3 pool and obtain their tokens at a discount.
Vulnerability Detail
Liquidations for Ichi Liquidity positions are calculated via the
get Price()
function in IchiOracle. However unlike the other Liquidation Oracles which are designed to be liquidation resistant, eg. depending on Chainlink Oracles, this depends on the price of Uniswap.It is not a Uniswap TWAP but the Uniswap price at a particular block, which makes price manipulation trivial.
Heres how the attacker can create an unfair liquidation:
Impact
Liquidity Providers on Blueberry Ichi Spell can be unfairly liquidated by attackers, with the attacker profiting from this transaction.
Code Snippet
https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/oracle/IchiLpOracle.sol#L19-L40
Tool used
Manual Review
Recommendation
A TWAP oracle should be used to calculate the value of Uniswap liquidity positions, or liquidations should not happen if the Uniswap price significantly differs from the price of external price oracles.
Duplicate of #20
The text was updated successfully, but these errors were encountered: