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.
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:
setNftHubAddressofRCFactorysetOrderbookAddressofRCFactorysetLeaderboardAddressofRCFactorysetMinRentalofRCTreasury
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
setNftHubAddressshortly 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.
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.