Skip to content

Malicious uses can prevente other users from issuing new RTokens by continuously issue and cancel RToken #367

@code423n4

Description

@code423n4

Lines of code

https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/RToken.sol#L186
https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/RToken.sol#L406-L418

Vulnerability details

Impact

The RToken issuance will not work, i.e users will not be able to mint new RTokens.

Proof of Concept

The issuing time of RToken is determined by RToken#allVestAt and issue amount.
Every issuance will increase the allVestAt, which will make later issuances to have a bigger issuing time.
Therefore, a malicious user can rapidly increase the allVestAt by issuing large issues, which makes all subsequent users have to wait a long time to issue.

Originally, this wouldn't be a big deal, because it requires the malicious user to pledge all the assets to the protocol.
But, RToken also has a RToken#cancel() function which allows a user to cancel his pending issuances in the issueQueues at any time without any cost.

Using this, the malicious user can extend the issuance period for all subsequent users quickly and costless by iteratively calling issue() and cancel().
Also because it is costless for calling cancel(), flashloan can be used to improve the efficiency of the attack.

Tools Used

Manual

Recommended Mitigation Steps

We can set a wait time for the cancel operation, that larger issuance will need wait more time to cancel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2 (Med Risk)Assets not at direct risk, but function/availability of the protocol could be impacted or leak valuebugSomething isn't workingduplicate-267satisfactorysatisfies C4 submission criteria; eligible for awards

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions