RubiconMarket.sol#isClosed() always returns false, making the market can not be stopped as designed
The market contract's isClosed() function was hardcoded to always return false, so the checks that should block new offers and buys after the market is stopped always passed. An attacker or any user could keep creating offers and buying even when the market was meant to be closed.
Submitted by WatchPug, also found by Ruhum, Chom, Dravee, Hawkeye, MaratCerby, minhquanym, csanuragjain, and fatherOfBlocks
function isClosed() public pure returns (bool closed) {
return false;
}
After close, no new buys are allowed.
Based on context and comments, when the market is closed, offers can only be cancelled (offer and buy will throw).
However, in the current implementation, isClosed() always returns false, so the checks on whether the market is closed will always pass. (E.g: can_offer(), can_buy(), etc)
And there is a storage variable called stopped, but it’s never been used, which seems should be used for isClosed.
Recommendation
Change to:
function isClosed() public pure returns (bool closed) {
return stopped;
}
bghughes (Rubicon) confirmed and commented:
Intended functionality - confirmed
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 isClosed() function was left as a stub returning a constant false instead of reading the stopped storage variable that was meant to track the market state.
Impact
The market could not be stopped as designed, so offers and buys would still be allowed after a close, defeating the intended shutdown control.
What the attacker needed
None
The fix
The function should return the stopped storage variable so the closed state is actually enforced; the report's recommendation was confirmed as intended functionality.
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 smart contract is a program that runs on a blockchain. This one has a switch meant to stop trading, but the function that reports whether the switch is on was written to always answer 'no'. So the safety checks that ask 'is trading stopped?' always got 'no' and let trades through.
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.