If the storage slots defined in the verifier contracts don't match the actual storage layout of the scrvUSD vault on Ethereum, the system would extract incorrect values, leading to manipulated prices.
In the ScrvusdVerifierV1.sol#L32-L40 contract, storage slots are hardcoded
Similarly, in ScrvusdVerifierV2.sol#L19
When the verifier extracts parameters from storage proofs: ScrvusdVerifierV1#L101-L105
If these slot numbers don't match the actual storage layout, the extracted values will be incorrect but will still pass verification because the proof is technically valid, it's just proving the wrong data.
If the scrvUSD vault on Ethereum is upgraded and its storage layout changes
If the hardcoded slot numbers were incorrect from the beginning
If multiple versions of scrvUSD
exist with different storage layouts
Since the ScrvusdOracleV2
relies on these parameters to calculate prices: ScrvusdOracleV2#L315-L322
Incorrect parameter values would lead to inaccurate price calculations. This could result in:
Mispriced assets in stableswap pools
Potential exploitation through arbitrage
Loss of funds for liquidity providers
Users must trust that the storage slot mapping is correct and remains correct over time.
Validating the storage layout of the live scrvUSD
contract and updating the slot numbers in verifiers to match would address the vulnerability.
Consider implementing a validation mechanism in the verifier that can detect if expected values fall outside reasonable bounds, which could provide an additional layer of security against using incorrect storage slots.
Invalid, - srCRVUSD is a minimal proxy, meaning it can never by upgraded, see [here](https://www.cyfrin.io/blog/upgradeable-proxy-smart-contract-pattern#:~:text=Minimal%20proxies%20are%20distinct%20from,provide%20upgrade%20or%20authorization%20functionality.) and [here](https://www.rareskills.io/post/eip-1167-minimal-proxy-standard-with-initialization-clone-pattern) for more info. - Even if srcrvUSD is migrated in the future via a new minimal proxy contract deployment (which is highly unlikely), the verifier contracts can be migrated along with it via revoking the access-control within the `ScrvusdOracleV2.vy` and then granting access to a new oracle. This is also not within the scope of this contest.
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.