Skip to content

Code4rena

Reality Cards (round 2)

Every publicly disclosed report for Reality Cards (round 2) and what kind of bugs they were.

disclosed reports
26
most reported class
Business logic
bug classes found
3
first disclosure
2021
Find Reality Cards (round 2) on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Reality Cards (round 2) chose to make public.

Business logic

Deposits don’t work with fee-on transfer tokens

The deposit function credits the user with the full amount requested, but fee-on-transfer tokens cause the contract to receive less than that amount. An attacker could deposit such a token and receive an inflated balance, potentially withdrawing more than they deposited.

Reality Cards (round 2)

Medium
Access control

Uninitialized Variable marketWhitelist in RCTreasury.sol

The marketWhitelist variable in RCTreasury.sol is never initialised, so marketWhitelistCheck() always returns true and does not enforce any whitelist restriction. An attacker could bypass intended access controls on restricted markets.

Reality Cards (round 2)

Medium
Access control

UberOwner has too much power

The Uber Owner role in the Reality Cards protocol has excessive power, allowing it to change core contract functionality and potentially reprogram the entire system. If the Uber Owner address is compromised, an attacker could take full control of the protocol.

Reality Cards (round 2)

High
Business logic

Parameter updates not propagated

Several setter functions in the RCFactory and RCTreasury contracts update only their own state variables and do not propagate the new addresses or values to other contracts that rely on them. This could cause unpredictable behaviour if the parameters are changed while contracts are active.

Reality Cards (round 2)

Medium
Business logic

findNewOwner edgecase

The findNewOwner function in RCOrderbook uses a loop counter to decide whether processing is complete, but when the loop ends exactly at the deletion limit, it incorrectly treats a valid new owner as invalid. This can cause a legitimate owner to be skipped and later deleted without receiving ownership, impacting availability.

Reality Cards (round 2)

High
Business logic

Deposits don’t work with fee-on transfer tokens

The deposit function records the requested token amount rather than the amount actually received, so fee-on-transfer tokens leave the contract's internal accounting out of step with its real token balance. An attacker could exploit this mismatch to withdraw more than they deposited.

Reality Cards (round 2)

Medium
DoS

Deposits can be denied by abusing maxContractBalance

The treasury contract enforces a maximum balance limit in its deposit function, which can be exploited by a whale who front-runs a user's deposit with a large deposit to hit the limit, causing the user's deposit to fail. This blocks users from depositing and renting cards, allowing an attacker to manipulate market outcomes.

Reality Cards (round 2)

Medium
Business logic

Function foreclosureTimeUser returns a shorter user’s foreclosure time than expected

The treasury contract's foreclosure-time calculation mixed the user's last rent calculation timestamp with a deposit-derived duration, so the resulting foreclosure time was earlier than it should be. This could cause incorrect determination of the new owner of a card when foreclosure is evaluated.

Reality Cards (round 2)

Medium
Business logic

RCFactory.createMarket() does not enforce _timestamps and _timestamps being larger than _timestamps , even though proper functioning requires them to be so

The market creation function does not enforce that the opening time is before the locking and resolution times, allowing a market to be created where locking and resolution occur before opening. An attacker could create such a market, potentially disrupting the intended sequence of events.

Reality Cards (round 2)

Medium
Business logic

Possible locked-ether (funds) Issue in RCOrderbook.sol

The RCOrderbook contract has a payable function that can receive native currency but lacks a way to withdraw it, potentially locking funds. An attacker could send funds to the contract, and they would be stuck.

Reality Cards (round 2)

Medium
Business logic

minRentalDayDivisor can be different between markets and treasury

The minimum rental day divisor can be updated in the treasury but not in already deployed markets, causing the treasury and markets to use different values. This could lead to unexpected results when calculating minimum rent time.

Reality Cards (round 2)

Medium
Business logic

maxSumOfPrices check is broken

The rentAllCards function's _maxSumOfPrices check does not account for the mandatory 10% price increase applied to each bid, so the total cost can exceed the user's specified limit. This could lead to insufficient funds, foreclosure, or unintended impacts on other bids.

Reality Cards (round 2)

Medium
Business logic

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.

Reality Cards (round 2)

Medium
Access control

Can access cards of other markets

The functions `ownerOf` and `onlyTokenOwner` in `RCMarket.sol` do not check that the card ID is less than the total number of cards, allowing a user to supply a larger ID and access cards belonging to other markets. This can be exploited in `upgradeCard` to circumvent the market approval check and potentially steal NFTs.

Reality Cards (round 2)

High
Business logic

NFT Hub implementation deviates from ERC721 for transfer functions

The NFT Hub contract overrides transfer functions but ignores approved addresses, so transfers initiated by approved addresses fail. This breaks compatibility with ERC721 and may cause issues with NFT platforms.

Reality Cards (round 2)

Medium
Business logic

RCNftHubL2.safeTransferFrom not according to spec

The safeTransferFrom function in RCNftHubL2 does not check whether the recipient contract implements IERC721Receiver, so tokens can be sent to contracts that cannot handle them. This violates the ERC721 specification and could result in tokens being stuck.

Reality Cards (round 2)

Medium
Business logic

Market-specific pause is not checked for sponsor

The treasury contract only checked its global pause flag, not the market-specific pause flag, when processing sponsorships. An attacker could sponsor a paused market, bypassing the intended pause restriction.

Reality Cards (round 2)

Medium
Access control

Critical uberOwner address changes should be a two-step process

The contracts allow the current uberOwner to change the uberOwner address in a single step without validating that the new address is correct. If the current uberOwner mistakenly sets an address they do not control, the system becomes permanently locked because the uberOwner cannot be corrected and all uberOwner-only functions become uncallable.

Reality Cards (round 2)

Medium
Access control

anyone can call function sponsor

The sponsor function in a smart contract lacked access control, allowing anyone to call it with an arbitrary address and transfer tokens from that address if they had a positive allowance to the contract. An attacker could steal tokens from any user who had approved the contract.

Reality Cards (round 2)

High
Business logic

payout doesn’t fix isForeclosed state

The payout function in RCTreasury.sol does not clear a user's isForeclosed status, even though receiving funds should allow them to lose that status. An attacker could remain foreclosed and be unable to place new bids without calling another function.

Reality Cards (round 2)

Medium
Business logic

Missing call to removeOldBids may affect foreclosure

The withdrawDeposit function in the Treasury contract did not call removeOldBids, so closed market bids remained counted in the user's bidRate, potentially causing an incorrect foreclosure. An attacker could exploit this to cause a user to be foreclosed upon when they should not be.

Reality Cards (round 2)

Medium
Business logic

Unchecked ERC20 transfers can cause lock up

The contract's topupMarketBalance function does not check the return value of an ERC20 transferFrom call, so if the token returns false instead of reverting on failure, the internal marketBalance can be inflated without actual tokens being transferred. This can cause other functions to fail with 'Books are unbalanced', locking up deposits and withdrawals.

Reality Cards (round 2)

High
Business logic

Deposit whitelist enforced on msg.sender instead of user

The Treasury deposit function enforces a deposit whitelist on the msg.sender address rather than the user address credited. A user whose msg.sender is blacklisted can still deposit from another whitelisted msg.sender while keeping their user address for leaderboards and NFTs.

Reality Cards (round 2)

Medium
Business logic

Wrong calculation on _collectRentAction

The smart contract function `_collectRentAction` incorrectly calculates a refund time using the current block timestamp instead of the user's foreclosure time. This miscalculation could allow an attacker to drain funds.

Reality Cards (round 2)

Medium