total_supply
is deducted in a wrong way that causes drain of pool
_obtain_price_params
function in the ScrvusdOracleV2
contract introduces a critical vulnerability due to the exponential reduction of total_supply
during calculations. This flaw can lead to wrong price calculations over time, subsequently allowing malicious actors to exploit the mispricing and drain pools.
https://github.com/CodeHawks-Contests/2025-03-curve/blob/main/contracts/scrvusd/oracles/ScrvusdOracleV2.vy#L266
The issue lies in the _obtain_price_params
function, where total_supply
is reduced over time as each iteration of the loop without minimum bounds.
Specifically, the reduction formula in below code section lets total_supply
to decrease exponentially over time. This could possibly leads to inaccurate price calculations.
Due to drastical incorrect price calculations, it could lead to
exploitation by malicious actors to drain pools relying on this oracle
loss of funds for liquidity providers and potential destabilization of the ecosystem.
Possibly we can resolve by
set min boundary on total_supply
deduction
set limitation on max_v2_duration
to reduce the implication
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.