update_price function lacks validation on PriceParams
The update_price function in ScrvusdOracleV2 contract lacks sufficient validation on PriceParams which could lead to an invalid state of pool.
https://github.com/CodeHawks-Contests/2025-03-curve/blob/main/contracts/scrvusd/oracles/ScrvusdOracleV2.vy#L295-L330
Here's the implementation of update_price function:
As seen above, there's no sufficient validation regarding price params. Notably, we need to check:
total_supply is no less than balance_of_self as well as above zero
last_profit_update is verified (valid against current timestamp)
full_profit_unlock_date is within the accepted limits
total_idle and total_debt are correct as their sum is equal to actual total assets
Invalid state of pool can lead to wrong prices and unexpected results over normal pool operations.
Add sufficient validation on the price params.
- 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.