The oracle stop when invalid parameters trigger a revert freezing price updates.
This vulnerability occur when the oracle revert during the price update leaving the oracle in a stale state.
https://github.com/CodeHawks-Contests/2025-03-curve/blob/198820f0c30d5080f75073243677ff716429dbfd/contracts/scrvusd/verifiers/ScrvusdVerifierV1.sol#L83-L111
The verifier in ScrvusdVerifierV1 fetches scrvUSD vault parameters (total_supply, balance_of_self) from Ethereum state but does not validate them:
The oracle update_price function attempt to compute the new price using the verifier parameters:
The oracle calculate _total_supply as total_supply - unlocked_shares. If balance_of_self > total_supply, this subtraction underflow causing unnecessary revert:
The entire update_price transaction revert and the oracle retains it last valid state (price_params, last_update).
then functions like price_v0/price_v1 return outdated values.
- Outdated prices allow arbitrageurs to drain liquidity.
- Lending protocols using the oracle misprice collateral.
Manual review
1. Add Parameter Validation in Verifier:
2. though optional but design the oracle to retain the last valid price if updates fail.
Note that `total_supply` and `profit_unlocking_rate` is initially set to 1 and 0 respectively when the `ScrvusdOracleV2.vy` is deployed 1. `total_supply` and `profit_unlocking_rate` is part of the price param updates within `update_price`, which must have gone through verification via the OOS `StateProofVerifier` contract, so there is no evidence that a 0 supply is allowed either via a 0 supply update or an extremely high `profit_unlocking_rate`. 2. Since price is retrieved via values retrived from the V3Vault, if there is no supply, there is arguably no price to be posted. As such, reverting is arguably the correct choice since a 0 price value is not expected from scrvUSD, which is a stable coin.
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.