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

_update_price function does not consider last prices in its logic

Summary

In SCRVUsdOraclev2.vy, the update_pricefunction does not use last_pricesfor smoothing.

Vulnerability Details

In update_pricefunction, it updates the last prices:

self.last_prices = [self._price_v0(), self._price_v1(), self._price_v2()]

However, it then updates the new price:

new_price: uint256 = self._raw_price(_ts, _ts)

There are multiple issues here:

  1. New price is updated without verifying that price change is within bounds (within max_change), purely based on the timestamp passed from the ScrvUsdVerifierV1.sol

    1. max_change is only checked in _smoothed_pricefunction, which is only called in the respective functions to calculate v0, v1, v2 prices.

  2. Last prices stores the smoothed v0, v1, v2 prices, but they are not included in the logic when updating the new price.

Impact

This breaks the core logic of the protocol to avoid sudden price jumps or manipulation. There is no protection for sudden price updates.

Tools Used

Manual

Recommendations

Ensure last prices are considered when updating the new price to avoid sudden price changes.

Updates

Lead Judging Commences

0xnevi Lead Judge
6 months ago
0xnevi Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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