The _unlocked_shares
function lacks a check on ts - last_profit_update
, allowing underflow if ts is less than last_profit_update
. This produces a large unlocked_shares
value, reducing _total_supply
and inflating the price in _raw_price
, which feeds the stableswap-ng pool.
Location: ScrvusdOracleV2.vy
Issue: No validation ensures ts >= last_profit_update
, causing underflow in uint256 subtraction, resulting in a huge unlocked_shares
.
Trigger: Future last_profit_update
from update_price
or _obtain_price_params
.
Inflated pool price enables risking LP losses and temporary disruption. No direct problem to the funds, but affects pool.
Manual code review
Add the bounds check:
This issues and duplicates are very similar to reasonings highlighted in issue #11. The timestamp variables are extracted and verified via the OOS `StateProofVerifier` contract inherited as `Verifier`. There is simply no concrete proof that the verifier allowed such an underflow to occur, representing stale price value updates.
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.