This repository has been archived by the owner on May 26, 2023. It is now read-only.
0x52 - IchiLpOracle is extemely easy to manipulate due to how IchiVault calculates underlying token balances #20
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
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
0x52
high
IchiLpOracle is extemely easy to manipulate due to how IchiVault calculates underlying token balances
Summary
IchiVault#getTotalAmounts
uses theUniV3Pool.slot0
to determine the number of tokens it has in it's position.slot0
is the most recent data point and is therefore extremely easy to manipulate. Given that the protocol specializes in leverage, the effects of this manipulation would compound to make malicious uses even easier.Vulnerability Detail
ICHIVault.sol
IchiVault#getTotalAmounts
uses theUniV3Pool.slot0
to determine the number of tokens it has in it's position. slot0 is the most recent data point and can easily be manipulated.https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/oracle/IchiLpOracle.sol#L27-L36
IchiLPOracle
directly uses the token values returned byvault#getTotalAmounts
. This allows a malicious user to manipulate the valuation of the LP. An example of this kind of manipulation would be to use large buys/sells to alter the composition of the LP to make it worth less or more.Impact
Ichi LP value can be manipulated to cause loss of funds for the protocol and other users
Code Snippet
Tool used
Manual Review
Recommendation
Token balances should be calculated inside the oracle instead of getting them from the
IchiVault
. To determine the liquidity, use a TWAP instead ofslot0
.The text was updated successfully, but these errors were encountered: