The update_price()
function in ScrvusdOracleV2.vy
is vulnerable to signature replay attacks. This vulnerability allows price verifiers to manipulate price movements by reusing previous parameter values, potentially leading to accelerated price changes beyond intended limits.
The issue lies in the interaction between two critical functions: _smoothed_price()
and update_price()
.
First, let's examine the _smoothed_price()
function:
The function calculates max_change
based on last_price
, making it susceptible to manipulation through repeated updates.
The update_price()
function implementation:
The critical vulnerability stems from:
No protection against signature replay
Updates to self.last_prices
on every call
Price changes being cumulative due to the current model
Malicious price verifiers can artificially accelerate price movements by repeatedly submitting the same parameters, potentially leading to market manipulation and economic damage to the protocol.
Manual Review, Code Analysis
Implement nonce-based signature verification
Add timestamp validation to prevent replay of old parameters
Consider implementing a cooldown period between price updates
- All proof generated within `_proof_rlp` is generated via the off-chain prover, so there is no concrete proof that this proofs are non-unique. - All state roots and proofs must be verified by the OOS `StateProofVerifier` inherited as `Verifier`, so there is no proof that manipulating proofs can successfully pass a price update
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.