Skip to content
Business logic Audit finding Intermediate

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.

gpersoon Follow

Originally disclosed on Code4rena

Submitted by gpersoon, also found by cmichel

There are several functions to update parameters. However these parameters are only updated on the top level and not propagated to the other contracts. This could lead to various unpredictable results. Examples are:

  • setNftHubAddress of RCFactory
  • setOrderbookAddress of RCFactory
  • setLeaderboardAddress of RCFactory
  • setMinRental of RCTreasury
function setNftHubAddress(IRCNftHubL2 _newAddress) external override onlyUberOwner {
    require(address(_newAddress) != address(0), "Must set Address");
    nfthub = _newAddress;
}

function setOrderbookAddress(IRCOrderbook _newOrderbook) external override {
    require( treasury.checkPermission(TREASURY, msgSender()), "Not approved" );
    orderbook = _newOrderbook;
}

function setLeaderboardAddress(IRCLeaderboard _newLeaderboard) external override {
    require( treasury.checkPermission(TREASURY, msgSender()), "Not approved");
    leaderboard = _newLeaderboard;
}

function setMinRental(uint256 _newDivisor) public override onlyRole(OWNER) {
    minRentalDayDivisor = _newDivisor;
}

Recommend implementing a way to notify the underlying contracts of the updates.

Splidge (Reality Cards) acknowledged:

We have come to realise that it is very unlikely we will be able to change certain contracts once they are in-use, the exception being the market where a new reference could be deployed. In practice we do use setNftHubAddress shortly after deploying new contracts, this is so that we can continue to use an existing NFT hub that has already been put through Matic Mintable Asset mapping, but changing this while a market is active would cause problems. While we accept that changing these parameters on active contracts may be troublesome we will not be making changes at this time, partly because it’s useful to be able to change these before the contracts are in use but also due to the potential risk of introducing new problems at this stage in the project.

The original report as published on Code4rena, by gpersoon. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

Impact

Changing these parameters on active contracts could lead to unpredictable results, though the team considers such changes unlikely in practice.

What the attacker needed

Privileged access to setter functions; active contracts using the parameters

The fix

The report recommends implementing a way to notify the underlying contracts of the updates, but the team chose not to make changes at this time.

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.

In a system of smart contracts, one contract may store an address that other contracts use. If you change that address in one place but not everywhere, the contracts can disagree about where to send calls. This report points out that some update functions only change the value locally, leaving other contracts with the old value.

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.

More by gpersoon

View all

47 more disclosed reports, best first.

More from Reality Cards (round 2)

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.