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

[L-01]Missing timestamp check in the function `ScrvusdOracleV2.vy:raw_price`

Summary

In the contract ScrvusdOracleV2.vy:raw_price():#L148 it says @param _ts Timestamp at which to see price (only near period is supported)yet there is no validation for this.

Vulnerability Details

In the contract ScrvusdOracleV2.vy:raw_price():#L148 it says @param _ts Timestamp at which to see price (only near period is supported)yet there is no validation for this.

@view
@external
def raw_price(
_i: uint256 = 0, _ts: uint256 = block.timestamp, _parameters_ts: uint256 = block.timestamp
) -> uint256:
"""
@notice Get approximate `scrvUSD.pricePerShare()` without smoothening
@param _i 0 (default) for `pricePerShare()` and 1 for `pricePerAsset()`
@param _ts Timestamp at which to see price (only near period is supported)
"""
#@> no checks if the timestamp is in the future or not
p: uint256 = self._raw_price(_ts, _parameters_ts)
return p if _i == 0 else 10**36 // p

Impact

A user can pass a timestamp in future or in the past to manipulate the raw price. It can be considered a low issue but many functions depend on the ScrvusdOracleV2.vy:_raw_price():#L286function which also doesn't have the check.

Tools Used

Manual review

Recommendations

Use checks to validate the value of the timestamps

@view
@external
def raw_price(
_i: uint256 = 0, _ts: uint256 = block.timestamp, _parameters_ts: uint256 = block.timestamp
) -> uint256:
"""
@notice Get approximate `scrvUSD.pricePerShare()` without smoothening
@param _i 0 (default) for `pricePerShare()` and 1 for `pricePerAsset()`
@param _ts Timestamp at which to see price (only near period is supported)
"""
+++ assert _ts <= block.timestamp and _parameters_ts <= block.timestamp
p: uint256 = self._raw_price(_ts, _parameters_ts)
return p if _i == 0 else 10**36 // p
Updates

Lead Judging Commences

0xnevi Lead Judge 3 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.