In ScrvUsdVerifierV1, the verifyScrvusdByStateRoot
and verifyScrvusdByBlockHash
function verifies either state root or block hash from Ethereum. However, these functions do not verify that the params passed into update_price
function is valid and non-zero.
In verifyScrvusdByBlockHash
:
In verifyScrvusdByStateRoot
:
As seen in code snippets above, the functions internally call extractParametersFromProof
--> this function first verifies that the account exists, then it extracts the slot values from the proof. When extracting the slot values, even if slots do not exist or return its value = 0, these values are still retrieved and makes up the params
. Then, these same params
are passed into updatePrice()
function.
The issue here is that proof validation does not automatically guarantee the validity of the parameters. For example, it is critical if totalSupply == 0 after initialisation, and unusual if totalIdle and totalDebt == 0. The validity of these parameters should be checked before calling _updatePrice() function.
Updating of self.price_params
could be incorrect due to lack of parameter value checks, hence easily impacting future price updates and price projections.
Manual
Set up checks for parameters that should not be 0 or extremely low/high values before passing extracted parameter values from proof into _updatePrice
function.
- 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.