The ScrvusdVerifier contract is vulnerable to a Denial of Service (DOS) attack through RLP decoding of large inputs. An attacker can craft a valid but extremely large RLP encoded header (10MB in the PoC) that will cause the transaction to fail due to excessive gas consumption. This can effectively prevent legitimate users from using the verification functionality.
##Vulnerbility Details:
The vulnerability lies in the update_price function at line 270-284 of ScrvusdOracleV2.vy. The function accepts unchecked parameters and processes them without size validation, making it susceptible to RLP-based DOS attacks.
The vulnerability specifically manifests in the following ways:
Line 273: No validation of _parameters array size
Line 274-275: No checks for timestamp and block number boundaries
Line 277: State changes without proper input validation
Save the test file in /tests/scrvusd/verifier/unitary
The test demonstrates that even with admin privileges, the transaction reverts due to gas limits when processing a large RLP header. This vulnerability could be exploited to:
Block legitimate verifications
Waste gas resources
Potentially cause contract lockup
Test Result:
1.Denial of service to legitimate users
2.Excessive gas consumption
3.Potential contract unavailability
4. Risk to the entire verification system
Implement strict input size validation:
Add gas consumption checks:
- 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.