Open code423n4 opened 1 year ago
New MAX_RATIO
is 0.01% or 1e14.
We think this is QA since requires governance to set ratio to 1e18.
tbrent marked the issue as disagree with severity
tbrent marked the issue as sponsor confirmed
0xean changed the severity to QA (Quality Assurance)
Lines of code
https://github.com/reserve-protocol/protocol/blob/c4ec2473bbcb4831d62af55d275368e73e16b984/contracts/p1/RToken.sol#L131-L150
Vulnerability details
FurnaceP1.MAX_RATIO = FIX_ONE, and the check in the setRatio:
It means ratio can be FIX_ONE, which means the rtoken reward will be vested after one block.
The first rtoken minter can mint only
X
wei rtoken and transfer it to the furnace. Then next block, the first minter mints only 1 wei rtoken again before the second minter enters. Now thebasket/rToken
rate will be increased byX
times.Impact
Dos. If the attacker mint 1 rtoken (1e18 wei rtoken) in the first issuance. The rate will be increased by 1e18 times, which means the second investor should pay 1e18 baskets (1e36 wei baskets) for 1 rtoken. Normally it would be worth 1 quintillion usd. No one can pay for it and afford calculation error.
Take manyfold collateral from the second investor. If the attacker mint 1 wei rtoken in the first issuance. And front run the next issuance with the second investor, the rate will be multiply by 2. So double collaterals will be taken away from the second investor. Although there is no immediate damage, it breaks the users' expectation and increases investment risk.
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
POC test/Furnace.test.ts git patch:
run test:
log:
Tools Used
Manual review
Recommended Mitigation Steps
Make melt radio can't be 1 or stop melt when balance in furnace is equal to totalSupply of RToken.
Assessed type
DoS