DeFiLayer 1Layer 2
14,723 OP
View results
Submission Details
Severity: high
Invalid

Price can be updated with uninitialized price parameters in verifyScrvusdByStateRoot() function

Summary

In ScrvUsdVerifierV1, the verifyScrvusdByStateRoot and verifyScrvusdByBlockHashfunction verifies either state root or block hash from Ethereum. However, these functions do not verify that the params passed into update_pricefunction is valid and non-zero.

Vulnerability Details

In verifyScrvusdByBlockHash:

uint256[PARAM_CNT] memory params = _extractParametersFromProof(block_header.stateRootHash, _proof_rlp);
return _updatePrice(params, block_header.timestamp, block_header.number);

In verifyScrvusdByStateRoot:

uint256[PARAM_CNT] memory params = _extractParametersFromProof(state_root, _proof_rlp);
// Use last_profit_update as the timestamp surrogate
return _updatePrice(params, params[5], _block_number)

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 paramsare 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.

Impact

Updating of self.price_paramscould be incorrect due to lack of parameter value checks, hence easily impacting future price updates and price projections.

Tools Used

Manual

Recommendations

Set up checks for parameters that should not be 0 or extremely low/high values before passing extracted parameter values from proof into _updatePricefunction.

Updates

Lead Judging Commences

0xnevi Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

[invalid] finding-missing-proof-content-validation

- 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

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.