DeFiLayer 1Layer 2
14,723 OP
View results
Submission Details
Severity: medium
Invalid

Hardcoded Storage Slots

Summary

The PARAM_SLOTS array contains hardcoded storage slot numbers.

  • Impact:

    • If the storage layout of the SCRVUSD contract changes (e.g., due to an upgrade), the verifier will extract incorrect data.

    • This could lead to severe price discrepancies and financial losses.

    • This is a large maintenance risk.

Vulnerability Details

https://github.com/CodeHawks-Contests/2025-03-curve/blob/main/contracts/scrvusd/verifiers/ScrvusdVerifierV1.sol#L32

Impact

Tools Used

Recommendations

  • External Configuration: Consider storing the slot numbers in a configurable storage or in a separate configuration contract.

  • Automated Verification: Implement automated tests to verify that the slot numbers match the actual storage layout of the SCRVUSD contract. This should be part of the continuous integration process.

  • Documentation: Maintain extremely clear and up-to-date documentation regarding the slot numbers and their corresponding parameters.

Updates

Lead Judging Commences

0xnevi Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Out of scope
Assigned finding tags:

[invalid] finding-upgradeable-verifier-contracts

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.