ChainlinkPriceOracle.getAssetPrice
lacks of decimal check.
#561
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-479
grade-b
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/oracles/ChainlinkPriceOracle.sol#L37-L39
Vulnerability details
Impact
In ChainlinkPriceOracle.getAssetPrice, the function assumes all price feed's decimal is equal, and this might be true for stETH/rETH/cbETH, but according to LRTConfig.addNewSupportedAsset and ChainlinkPriceOracle.updatePriceFeedFor, the protocol might add new asset in feature, in such case, the assumption might not hold true.
Proof of Concept
ChainlinkPriceOracle.getAssetPrice is defined as:
Tools Used
VIM
Recommended Mitigation Steps
Assessed type
Decimal
The text was updated successfully, but these errors were encountered: