Closed sherlock-admin4 closed 2 months ago
1 comment(s) were left on this issue during the judging contest.
merlinboii commented:
Low at best as the price received from feed has min/max validation and the admin can control over the price using the manually submission via the custom aggreator
Breeje
Medium
DepositVault
will allow minting excessivemToken
to User in case of WBTC Depeg eventSummary
DepositVault
will allow minting excessivemToken
to User in case of WBTC Depeg event.Root Cause
The
DepositVault
contract relies on the USD value of deposited tokens to calculate themintAmount
ofmTokens
.The current
DataFeed
implementation fails to account for potential WBTC depegging.This flaw in the price feed causes inaccurate
mToken
calculations, potentially allowing users to mint moremTokens
than they should receive.As the severe impact clearly falls on the contract in scope, submitting this issue.
Internal pre-conditions
None.
External pre-conditions
WBTC
depegs fromBTC
from 1:1 ratio, similar to theUSDC
depeg event in March 2023.Attack Path
Alice deposits
0.1 WBTC
(worth$6,000
at the time) using thedepositInstant
function.The
_calcAndValidateDeposit
function calls_convertTokenToUsd
to determine the token's USD value and the current rate._getTokenRate
retrieves the value from Chainlink viaIDataFeed(dataFeed).getDataInBase18()
.The
DataFeed
contract is implemented as follows:Since there is no direct
WBTC/USD
Feed available from chainlink on Ethereum and givenDataFeed
uses only 1 feed, it is expected to useBTC/USD
feed instead.During a WBTC depeg, the
DepositVault
will still receive the unchangedBTC/USD
value, ignoring the devaluation ofWBTC
.As a result, the
mintAmount
ofmTokens
issued to the user remains inflated, allowing the user to exploit the difference by depositing undervalued WBTC and receiving excessivemTokens
.Impact
Depositors will get excessive
mToken
than intended in case of WBTC Depeg.PoC
No response
Mitigation
Straightforward mitigation is to Update the Chainlink retrieval method to use both the WBTC/BTC Price Feed and BTC/USD Price Feed to derive the accurate
WBTC/USD
price.