Missing validation on proof in verifyScrvusdByStateRoot
could lead to wrong price calculation
There is no check on validity of the timestamp (param[5]
), which is used to update price.
In verifyScrvusdByStateRoot
function of ScrvusdVerifierV1
contract, there is no check on validity of the timestamp (param[5]
) which represents the last_profit_update
.
When tampered by a malicious provider, it will result a significant error in _updatePrice
function that's being called afterwards.
This is a discrepency compared to verifyScrvusdByBlockHash
function where the timestamp is acquired from the block header itself.
Due to the possibility of proof manipulation, price can be sorted out wrongly and result in consequent errors in pool operations. Potential loss of funds are expected in case the malicious actors manage the proof in a way they can drain funds from the pool.
Update verifyScrvusdByStateRoot
to get the timestamp from a trusted source rather than directly from the proof. Consider following the approach from verifyScrvusdByBlockHash
function to get it from the block header.
- 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.