In the ScrvusdVerifierV1 contract’s verifyScrvusdByStateRoot function, the last_profit_update (params[5]) is used as the timestamp parameter for updating the price in the Oracle. However, the contract does not check whether params[5] is 0 or an invalid value, and passes it directly to the Oracle.
In the current cross-chain scrvUSD oracle implementation, the ScrvusdVerifierV1
contract extracts key parameters from state proofs and passes them to the update_price
function of the ScrvusdOracle
contract. However, two severe vulnerabilities exist here:
Missing Validation of the Parameter last_profit_update
(i.e., params[5]
) in the Verifier contract:
As indicated by contract comments, the storage slot may not exist and defaults to zero.
If this parameter is zero, the Verifier incorrectly uses 0
as a valid timestamp for updating the oracle price.
2.Lack of Validation for the External Timestamp (_ts
) in the Oracle contract’s** update_price
function:
The function directly assigns the externally provided _ts
to self.price_params_ts
without any validation.
There's no check whether _ts
is an abnormal timestamp (far past or future).
These two issues, when combined, may allow an verifier providing a abnormal timestamps to update price.(As indicated by contract comments, the storage slot may not exist and defaults to zero.)
The Oracle contract accepts zero as valid without validation, significantly distorting internal computations.It severely jeopardizes the accuracy of the oracle's pricing.
N/A
Add strict timestamp validation in the update_price 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.