mint function in RToken contract is defined as follows:
The issue arises because _mint function, which will ultimately mint RToken (interest-bearing token users receive when depositing CRVUSD in the lending pool), uses amountToMint (amount in underlying asset unit) as the amount of RToken to mint, instead of amountScaled(amount of tokens to mint after dividing amountToMint by the index, which is computed but only used as a return value).
The vulnerability is serious as _mint function will mint to many tokens in regards of how many underlying assets have been deposited.
This means an attacker could deposit an amount, and withdraw right after a greater amount, taking some profits at the expense of other users. This would actually allow any attacker to drain the entire CRVUSD balance of the RToken contract (which held underlying assets when depositing in the lending pool) by repeatedly calling deposit and withdraw
The impact of this issue is high as this miscalculation in the amount of RToken to mint will lead to systematic withdrawals of too many underlying assets in regards of how many underlying assets were deposited.
Any user could take advantage of this vulnerability and drain the entire CRVUSD balance in RToken contract.
Manual review.
Ensure that the right amount of tokens is minted during deposits:
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.