-
Notifications
You must be signed in to change notification settings - Fork 4
min and maxAnswer never checked for oracle price feed #16
Copy link
Copy link
Open
Labels
2 (Med Risk)Assets not at direct risk, but function/availability of the protocol could be impacted or leak valueAssets not at direct risk, but function/availability of the protocol could be impacted or leak value🤖_primaryAI based primary recommendationAI based primary recommendationM-06bugSomething isn't workingSomething isn't workingprimary issueHighest quality submission among a set of duplicatesHighest quality submission among a set of duplicatesselected for reportThis submission will be included/highlighted in the audit reportThis submission will be included/highlighted in the audit reportsponsor confirmedSponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Metadata
Metadata
Assignees
Labels
2 (Med Risk)Assets not at direct risk, but function/availability of the protocol could be impacted or leak valueAssets not at direct risk, but function/availability of the protocol could be impacted or leak value🤖_primaryAI based primary recommendationAI based primary recommendationM-06bugSomething isn't workingSomething isn't workingprimary issueHighest quality submission among a set of duplicatesHighest quality submission among a set of duplicatesselected for reportThis submission will be included/highlighted in the audit reportThis submission will be included/highlighted in the audit reportsponsor confirmedSponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2024-05-bakerfi/blob/main/contracts/oracles/EthOracle.sol#L31
Vulnerability details
Description
Chainlink aggregators have a built in circuit breaker if the price of an asset goes outside of a predetermined price band. The result is that if an asset experiences a huge drop in value (i.e. LUNA crash) the price of the oracle will continue to return the minPrice instead of the actual price of the asset. This would allow user to continue borrowing with the asset but at the wrong price. This is exactly what happened to Venus on BSC when LUNA imploded. However, the protocol misses to implement such a check.
Link to code:
Similar past issues
Tools Used
Manual review
Recommended Mitigation Steps
Add logic along the lines of:
min and max prices can be gathered using one of these ways.
Assessed type
Oracle