Closed c4-bot-9 closed 3 months ago
view
-ing a function you can get an accurate state of the chain is misguided, essentially you can imagine the same thing happening by another person issuing in the same block, or several other things in the protocol to do with the rate of RTokens.melt
does NOT impact the throttles and throttle is for external issuance and redemption.thereksfour marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-07-reserve/blob/3f133997e186465f4904553b0f8e86ecb7bbacbf/contracts/p1/RToken.sol#L430 https://github.com/code-423n4/2024-07-reserve/blob/3f133997e186465f4904553b0f8e86ecb7bbacbf/contracts/p1/RToken.sol#L436 https://github.com/code-423n4/2024-07-reserve/blob/3f133997e186465f4904553b0f8e86ecb7bbacbf/contracts/p1/RToken.sol#L110 https://github.com/code-423n4/2024-07-reserve/blob/3f133997e186465f4904553b0f8e86ecb7bbacbf/contracts/p1/RToken.sol#L185
Vulnerability details
When users want to redeem or issue a large amount of tokens, they are likely to make use of the
issuanceAvailable
andredemptionAvailable
functions:Let's now imagine a user uses these values to issue/redeem the maximum RToken amount they can.
Whether they call
issue
,issueTo
,redeem
,redeemTo
, orredeemCustom
, theassetRegistry.refresh()
function is inevitably called.In turn,
assetRegistry.refresh()
callsbasketHandler.trackStatus()
which callsrefresh()
for all the assets registered in the Rtoken. Among these, there isRTokenAsset
, whoserefresh()
function callsfurnace.melt()
:which in turn burns part of the RTokens held:
Burning RTokens reduces its supply, and with it, the throttle limit, causing any calls at the limit or slightly below to fail.
Impact
RTokens issuances and redemptions at full throttle or slightly lower can fail when Furnace holds a balance, either from past distributions or from malicious external donations made to DoS the transactions.
Proof of Concept
RToken.issuanceAvailable
and callRToken.issue
at limit or a little belowTools Used
Code review, Foundry
Recommended Mitigation Steps
Consider conservatively removing any RToken balance held by the Furnace from the supply considered for the throttle limit calculation in
issuanceAvailable
andredemptionAvailable
.Assessed type
DoS