The oracle blindly trust the verifier inputs without sanitization. While the verifier is trusted to provide accurate data, the oracle should still enforce safety constraints (profit_max_unlock_time ≥ 1 hour).
This vulnerability occur when the profit_max_unlock_time parameter is updated without validationallowing values that could destabilize the oracle price calculations. The profit_max_unlock_time determine how quickly profits are distributed to scrvUSD holders so unvalidated malicious or incorrect values can lead to division by zero leading to revert via overflow protection or even skewed price simulations.
In ScrvusdVerifierV2.sol, the verifier read the profit_max_unlock_time from the scrvUSD vault storage slot through state proofs:
The verifier call the update_profit_max_unlock_time in the oracle contract with the extracted value:
No validation is performed on _profit_max_unlock_time here.
The profit_max_unlock_time is critical in the _obtain_price_params function for simulating scrvUSD price:
- Division by Zero: If profit_max_unlock_time = 0 then number_of_periods calculation will fail making oracle price update stop breaking dependent protocols.
- Overly Large Values: If profit_max_unlock_time is set to an extremely large value (`1e18`), number_of_periods become `0`, freezing profit distribution simulations and oracle return stale prices leading to pool arbitrage losses.
1. A verifier submit profit_max_unlock_time = 0 through verifyPeriodByBlockHash.
2. profit_max_unlock_time is set to 0 in the oracle.
3. The next call to _obtain_price_params trigger division by zero reverting all price updates.
4. Stableswap-ng pools relying on the oracle cannot update prices leading to liquidity provider loss.
1. Ensure profit_max_unlock_time is within reasonable bounds during extraction:
2. Add validation in the oracle
- 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.