Severity: Medium
Category: Input Validation
Impact: Potential price manipulation through timestamp specification
Likelihood: Medium (requires compromised trusted role)
Contract: ScrvusdOracleV2.vy
Function: update_price
Line(s) Affected: ~325-343
The update_price
function validates that _block_number
is not outdated but fails to perform any validation on the provided timestamp _ts
. This allows a verifier to specify arbitrary timestamps that can significantly affect price calculations.
A compromised or malicious actor with the PRICE_PARAMETERS_VERIFIER role calls update_price
They provide a timestamp _ts
that is significantly different from the actual block timestamp
This manipulation influences all price calculations, particularly price_v1
which relies directly on the stored timestamp
The manipulated prices create arbitrage opportunities at the expense of liquidity providers
Use block.timestamp directly instead of allowing custom timestamps
Implement a time-weighted average price (TWAP) mechanism to reduce the impact of timestamp manipulation
Add additional validation requiring multiple verifiers to confirm the timestamp
Impact: Medium to High - Manipulated timestamps can lead to incorrect price calculations, creating arbitrage opportunities and potential pool imbalances
Likelihood: Medium - The vulnerability requires a compromised or malicious actor with the PRICE_PARAMETERS_VERIFIER role, which is a trusted position in the system
- 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.