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

PERIOD_SLOT Value Extraction Can Be Manipulated

Summary

Lack of Validation on Extracted Slot Value

require(slot.exists); return slot.value;

  • The contract does not check if slot.value is within a reasonable range.

  • A malicious state proof could trick the contract into setting an arbitrary period.

Potential Exploit

  • Attacker constructs a fake state proof where slot.value = 2^256 - 1, causing integer overflow issues.

  • If the downstream contract relies on profit_max_unlock_time for financial calculations, this could lead to:

    • Funds being locked permanently.

    • Mispriced assets in DeFi protocols.

Vulnerability Details

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

Impact

Tools Used

Recommendations

  • Add upper and lower bounds on extracted values:

    require(slot.value > 0 && slot.value < MAX_PERIOD, "Invalid period value");

  • Use timestamp checks if the value represents a time-based parameter.

Updates

Lead Judging Commences

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

[invalid] finding-missing-proof-content-validation

- 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

Support

FAQs

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