The ScrvusdVerifierV1 and ScrvusdVerifierV2 contracts rely on a BlockHashOracle to verify Ethereum state proofs. However, as explicitly mentioned in the documentation, this oracle can "rarely provide an incorrect blockhash," creating a vulnerability where the system might accept manipulated state proofs, leading to incorrect price reporting for scrvUSD.
The verifier contracts validate state proofs against blockhashes or state roots obtained from the BlockHashOracle:
While the code validates that the provided blockhash matches what's reported by the oracle, it cannot detect if the oracle itself provides incorrect data. The README states:
It can rarely provide an incorrect blockhash, but not an incorrect block number.
This creates a trust assumption about the BlockHashOracle that, if violated, undermines the entire verification process. Since the blockhash/state root is the foundation for verifying all other data, an incorrect value here would allow validating incorrect scrvUSD parameters.
If the BlockHashOracle provides an incorrect blockhash:
An attacker could craft state proofs against this incorrect state
These proofs would pass verification
Incorrect scrvUSD parameters would be set in the oracle
This could lead to incorrect price reporting
While ScrvusdOracleV2 implements price smoothing that limits the rate of price changes:
This only slows down the impact rather than preventing it. Over time, an attacker could manipulate the price enough to profit from arbitrage in stableswap pools using this oracle.
The impact is classified as Medium because:
Fund loss is possible but indirect
Existing safeguards limit the magnitude and speed of exploitation
The system allows for correction of bad blockhashes
Manual code review
Implement Multi-Source Oracle Validation:
Add Parameter Sanity Checks:
Implement a Timelock for Oracle Updates:
Create a system where updates are proposed and only executed after a delay, allowing time for verification or challenges.
Add More Restrictive Age Verification:
Consider Medianizer Pattern:
Implement a system that takes the median of multiple oracle updates rather than relying on a single source.
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.