The ScrvusdOracleV2
contract lacks validation for the profit_max_unlock_time
parameter, allowing it to be set to zero. This results in division-by-zero errors in critical calculations, halting oracle functionality and destabilizing dependent systems.
File: contracts/scrvusd/oracles/ScrvusdOracleV2.vy
Function: update_profit_max_unlock_time
Issue: Missing check for _profit_max_unlock_time > 0
.
The update_profit_max_unlock_time
function permits _profit_max_unlock_time = 0
. When used in _obtain_price_params
, this causes division by zero:
Division-by-zero errors will revert price calculations, freezing the oracle.
Manual Code Review: Identified missing validation in state-changing functions.
Add an assertion to enforce _profit_max_unlock_time > 0
:
- See [here]([https://github.com/CodeHawks-Contests/2025-03-curve?tab=readme-ov-file#blockhash-oracle)](https://github.com/CodeHawks-Contests/2025-03-curve?tab=readme-ov-file#blockhash-oracle) on how it is used to verify storage variable - All state roots and proofs must be verified by the OOS `StateProofVerifier` inherited as `Verifier` (where the price values and params are extracted), so there is no proof that manipulating timestamp/inputs can affect a price update - It is assumed that the OOS prover will provide accurate data and the OOS verifier will verify the prices/max unlock time to be within an appropriate bound/values - There is a account existance check in L96 of `ScrvusdVerifierV1.sol`, in which the params for price updates are extracted from
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.