The setETHUSDOracle
function in the UpdateWeightRunner contract allows an admin to update the address of the ETH/USD oracle. However, the function currently does not include a check to prevent the ethUsdOracle
from being set to the zero address. This issue can lead to the contract failing to interact with an actual oracle, causing operational issues.
The issue is located in the setETHUSDOracle
function in the contract:
Lack of Zero Address Protection: In the current implementation, the setETHUSDOracle
function does not properly protect against the possibility of setting the ETHUSDOracle address to address(0)
. This issue occurs because there is no require
statement, which is meant to prevent this, does not enforce the check at the point of call or with adequate clarity.
The absence of a valid ETHUSDoracle will cause price data to be unavailable, potentially locking up contract operations or causing incorrect behavior in contract interactions.
Operational Failure: The inability to fetch ETH/USD data would break any features in the contract that rely on this data.
Manually source code review.
Here is fixed version of this function:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.