Closed code423n4 closed 2 years ago
Very low risk to the point was going to dispute this. Adding oracle is behind governance and even if the zero address was added then someone would have to create and mint options with that address.
I'm not a fan of zero address checks in governance functions, but given the lasting damage to the protocol in this case is warranted as it would lead to a data integrity issue. There would be no immediate risk of lost funds even then, so downgraded to QA issue.
include with QA Report #61
Lines of code
https://github.com/code-423n4/2022-03-rolla/blob/main/quant-protocol/contracts/pricing/oracle/ProviderOracleManager.sol#L25
Vulnerability details
Impact
Missing non-zero address check for
_oracle
parameter inProviderOracleManager.addAssetOracle()
. In the comments for functionaddAssetOracle()
(see here) it states "Once an oracle is added for an asset it can't be changed!".Adding a zero-address oracle would break core functionality and the oracle for an asset could not be changed again.
Proof of Concept
pricing/oracle/ProviderOracleManager.sol
Adding zero-address for parameter
_oracle
will break usage of protocol as it can not be reverted.Tools Used
slither and manual review
Recommended mitigation steps
Add non-zero address check for
_oracle
inaddAssetOracle()
: