Submitted by HollaDieWaldfee
https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/RToken.sol#L439-L514
https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/RToken.sol#L448
https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/BasketHandler.sol#L183-L192
The Reserve protocol allows redemption of rToken even when the protocol is paused.
The docs/system-design.md documentation describes the paused state as:
Redemption of rToken should only ever be prohibited when the protocol is in the frozen state.
You can see that the RToken.redeem function (https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/RToken.sol#L439-L514) has the notFrozen modifier so it can be called when the protocol is in the paused state.
The issue is that this function relies on the BasketHandler.status() to not be DISABLED (https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/RToken.sol#L448).
The BasketHandler.refreshBasket function (https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/BasketHandler.sol#L183-L192) however, which must be called to get the basket out of the DISABLED state, cannot be called by any user when the protocol is paused.
When the protocol is paused it can only be called by the governance (OWNER) address.
So in case the basket is DISABLED and the protocol is paused, it is the governance that must call refreshBasket to allow redemption of rToken.
This is dangerous because redemption of rToken should not rely on governance to perform any actions such that users can get out of the protocol when there is something wrong with the governance technically or if the governance behaves badly.
The RToken.redeem function has the notFrozen modifier so it can be called when the protocol is paused (https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/RToken.sol#L439).
The BasketHandler.refreshBasket function can only be called by the governance when the protocol is paused:
https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/BasketHandler.sol#L186-L190
Therefore the situation exists where rToken redemption should be possible but it is blocked by the BasketHandler.refreshBasket function.
VSCode
The BasketHandler.refreshBasket function should be callable by anyone when the status() is DISABLED and the protocol is paused.
So the above require statement can be changed like this:
It was discussed with the sponsor that they might even allow rToken redemption when the basket is DISABLED.
In other words only disallow it when the protocol is frozen.
This however needs further consideration by the sponsor as it might negatively affect other aspects of the protocol that are beyond the scope of this report.
0xean (judge) commented:
pmckelvy1 (Reserve) acknowledged
0xean (judge) commented:
tbrent (Reserve) mitigated:
Status: Mitigation confirmed. Full details in reports from 0xA5DF, HollaDieWaldfee, and AkshaySrivastav.
