Flows can bypass market and global pause
The pause mechanism in the Reality Cards contracts only blocks some token flows, leaving other public functions such as topping up a market balance callable while markets are paused. An attacker could change contract state during an emergency pause, which the reporter says could make it hard or impossible to restart the contracts correctly.
Submitted by 0xRajeev
Ability to pause all token transfers and all state changes for contracts is a “guarded-launch” best-practice for emergency situations for newly launched projects. The project implements this using a marketsPaused flag per market and a globalPause flag across all markets.
While these prevent renting of cards in a specific market and deposit/withdraw/rent cards across all markets, there are still public/external functions that are unguarded by these flags which can affect contract state in paused scenarios that will make it hard/impossible to recover correctly from the emergency pause.
Examples includetopupMarketBalance() and refundUser() in Treasury can be triggered even in a globalPause scenario. There could be other function flows where it is not obvious that market/global pausing is enabled because it is enforced in one of the functions called deep within the code within one of the conditionals.
The impact is that markets get paused but the contracts cannot be restarted because of state changes affected during the pause via unguarded external/public functions.
Recommend applying marketPaused and globalPause check clearly in the beginning of all public/external functions which move tokens/funds in/out or change contract state in any way. Also, Validate all possible control flows to check that market/global pausing works in all scenarios and applies to all contract state and not specific functionalities.
Splidge (Reality Cards) disputed and disagreed with severity:
marketPauseis declaredas only limiting rentals in a specific market.globalPauseis declaredas stopping deposits, withdraws and rentals across all markets. Therefore they are functioning as intended.Also, the example of
refundUser()is not true, it will fail in aglobalPausebecause it is only called by markets during a rent collection and a rent collection requires the calling ofpayoutwhich is restricted byglobalPause.
topupMarketBalancedoes appear to be a deposit of sorts. I think the warden’s take on the issue is valid and sponsor should seriously consider looking closer at the potential side effects of not fully pausing intentional transfer functions.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the pause checks were placed inside only some functions rather than at the start of every public or external function that moves funds or changes state.
Impact
Markets could be paused but the contracts may not be restartable because state changed during the pause through unguarded functions; the sponsor disputed this, arguing the flags work as intended and that the refund example fails under a global pause.
What the attacker needed
Contracts deployed with pause feature; attacker can call public functions
The fix
The pause checks should be applied at the start of every public or external function that moves tokens or changes contract state, and all control flows should be validated.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A pause switch is meant to freeze a contract in an emergency, like a big stop button. Here the stop button only blocked some actions, so other actions could still change the contract's stored data while it was supposedly frozen. That could leave the contract in a messy state that is hard to recover from.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.