Submitted by rbserver, also found by halden, McToady, JC, karanctf, tnevler, hunter_w3b, dec3ntraliz3d, Viktor_Cortess, lukris02, Udsen, Ace-30, Ocean_Sky, AlexCzm, R2, darksnow, fs0c, ktg, carrotsmuggler, MatricksDeCoder, whoismatthewmc1, Juntao, Kaysoft, tallo, Banditx0x, mrpathfindr, bearonbike, mrpathfindr, descharre, Shubham, said, ljmanini, MalfurionWhitehat, btk, Dug, sces60107, ginlee, iliyaniliev, dacian, koxuan, pavankv and ravikiranweb3.
Although the following ExpiringMarket.stop function can be called by the RubiconMarket contracts owner, calling it does not stop the market because stopped is not used at all in the protocol for pausing any of the markets functionalities.
https://github.com/code-423n4/2023-04-rubicon/blob/main/contracts/RubiconMarket.sol#L628-L630
Moreover, the following ExpiringMarket.isClosed function always returns false. This means that the market cannot be closed. Since this ExpiringMarket.isClosed function is called in the ExpiringMarket.can_offer and ExpiringMarket.can_buy modifiers below, these modifiers require(!isClosed()) will always pass, and new offers and buys are always allowed. Similarly, the below RubiconMarket.can_cancel modifiers require statements isClosed() check is always false so the situation, where the user wants to cancel an offer when the market is closed, does not exist at all.
https://github.com/code-423n4/2023-04-rubicon/blob/main/contracts/RubiconMarket.sol#L620-L622
https://github.com/code-423n4/2023-04-rubicon/blob/main/contracts/RubiconMarket.sol#L596-L607
https://github.com/code-423n4/2023-04-rubicon/blob/main/contracts/RubiconMarket.sol#L718-L729
Since calling the ExpiringMarket.stop and ExpiringMarket.isClosed functions cannot close or stop the market, the RubiconMarket contracts owner is unable to pause any functionlities of the market and prevented any unintended outflow and loss of user funds when an emergency occurs, such as if the protocol gets attacked and hacked.
The following steps can occur for the described scenario.
VSCode
The ExpiringMarket.stop function can be updated to set stopped to true or false by the RubiconMarket contracts owner. The ExpiringMarket.isClosed function can then be updated to return stopped. This enables the RubiconMarket contracts owner to pause and unpause the markets functionalities when needed.
daoio (Rubicon) acknowledged and commented:
HickupHH3 (judge) commented:
