There is no upper bound limit check for _block_number
ScrvusdOracleV2.vy::update_price call parameter
This allows caller to lock a price configuration for a really long period of time, and make it unable to change it later.
Assume n = current blocknumber (block.number)
Verifier calls update_price with _block_number = n + 100_000
Now contract sets:
self.last_block_number = _block_number
If _block_number
is too far away from current block, then price configuration cant be updated anymore until defined long time has passed because this condition:
Eg, suppose _block_number
parameter = n = 80_000_000
If block time is 12 secs (as in ETH mainnet) this means that update time is locked for 30 years
Ie no further modification can be made until 30 years has passed.
Proof of Concept
The following PoC shows the described scenario:
A call to update_price is performed with _block_number
parameter equal to ~30 years in block numbers (assuming 12 sec per block)
Next and attempt to change price configuration before 30 years has passed are performed, but will be reverted
Add code in tests/scrvusd/oracle/unitary/test_v2.py
Exec test with:
Note -s flag
The second call to update_price fails due to price configuration is locked for more than 30 years due to no upper limit on _block_number
parameter on update_price
The lack of upper bond limit for _block_number
ScrvusdOracleV2.vy::update_price parameter could lead to the inability to change price configuration for a very long periods of time
Manual Review
Implement an upper limit offset for _block_number
parameter based on current block.number
- Anything related to the output by the `BLOCK_HASH_ORACLE` is OOS per \[docs here]\(<https://github.com/CodeHawks-Contests/2025-03-curve?tab=readme-ov-file#blockhash-oracle>). - The PoC utilizes a mock `BLOCK_HASH_ORACLE`which is not representative of the one used by the protocol - Even when block hash returned is incorrect, the assumption is already explicitly made known in the docs, and the contract allows a subsequent update within the same block to update and correct prices - All state roots and proofs must be verified by the OOS `StateProofVerifier` inherited as `Verifier`, so there is no proof that manipulating block timestamp/block number/inputs can affect a price update - There seems to be a lot of confusion on the block hash check. The block hash check is a unique identifier of a block and has nothing to do with the state root. All value verifications is performed by the OOS Verifier contract as mentioned above
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.