The update_price
function in ScrvusdOracleV2.vy accepts raw parameters without sufficient validation, potentially allowing invalid state updates.
When updating price parameters, the function accepts all inputs without validating their consistency or reasonableness
There are no checks to ensure:
total_supply
is greater than or equal to balance_of_self
The timestamps (full_profit_unlock_date
, last_profit_update
) are reasonable
total_supply
is not zero (which would cause division by zero in price calculations)
Invalid parameters could lead to incorrect price calculations or unexpected reverts when calculating prices, potentially causing the oracle to malfunction.
If invalid parameters (e.g., total_supply = 0
or balance_of_self > total_supply
) are set, key functions like price_v0
, price_v1
, or price_v2
could revert due to underflows or division by zero, causing a denial-of-service (DoS) for the oracle.
Incorrect price calculations could propagate to dependent protocols (e.g., AMM pools), leading to financial losses or manipulation.
Manual Review
Add parameter validation before updating the state:
Ensure total_idle + total_debt
matches the vault's actual assets (off-chain checks).
- 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.