A reentrancy vulnerability exists in the _updatePrice()
function due to an unchecked external call to the SCRVUSD_ORACLE.update_price()
function. If the oracle is malicious or compromised, it could re-enter the contract and manipulate verification logic.
Reentrancy Risk in Oracle Call
Description:
The function _updatePrice()
directly calls update_price()
on SCRVUSD_ORACLE
, which is an external contract. If this oracle allows reentrant calls, it could call back into the contract before execution is complete, leading to unexpected state changes or data manipulation.
=>No checks are performed before or after calling update_price().
=>If the oracle calls back into this contract, it may disrupt price verification logic.
=>Data Integrity Risk: The oracle could exploit reentrancy to manipulate price updates.
=>Unexpected State Changes: If verification functions rely on a compromised oracle, the contract might process invalid or manipulated data.
=>Security Exploit Potential: A malicious oracle contract could trigger a reentrancy attack, leading to unexpected behavior.
=> manual review
Use Reentrancy Guard
Use OpenZeppelin’s ReentrancyGuard to prevent reentrant calls:
=>The nonReentrant modifier blocks reentrant calls, making the contract safer.
Apply Checks-Effects-Interactions Pattern
Modify _updatePrice()
to update state first before calling an external contract:
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.