In OracleUpgradeable.sol:20
, there is a critical vulnerability where an attacker may use a custom contract with manipulated token decimals to interact with the getPriceInWeth
function. This function is intended to provide the price of a token in terms of WETH (Wrapped Ether), which is crucial for calculating the value of collateral in the LendingProtocol. The discrepancy arises when the attacker's token reports incorrect decimal information, leading the protocol to overestimate the value of the provided collateral.
USDC has 6 decimals for example.
So when someone would provide usdc as collateral, he could borrow way more funds as his actual collateral is due to the mismatch in decimals with custom erc20 tokens.
Vulnerable function:
POC:
Loss of funds for the protocol
Liquidation of liquidity pools
Huge gains for the hacker if the protocol has a high tvl
Manual Review
Vs Code
Use a offchain oracle provider like chainlink to provide token details or token prices to ensure these kind of oracle attacks can not happen
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.