Possible centralization issue around RandProvider
The owner can replace the randomness provider with an arbitrary contract, which could brick reveals or let a malicious owner control the seed. This could prevent minting or allow the owner to set randomness in their favour.
Submitted by minhtrng, also found by 0xSmartContract, IllIllI, and rbserver
While it is very common for web3 projects to have privileged functions that can only be called by an admin address, special thought should be given to functions that can break core functionality of a project.
One such function is ArtGobblers.upgradeRandProvider(). If this is called passing a non-compatible contract address or EOA, requesting new seeds will be bricked and as a consequence reveals will not be possible. Also the seed could be controlled using a custom contract which would allow a malicious actor to set seeds in his favor.
Naturally, the assumption that the deployer or a multisig (likely that ownership will probably be transferred to such) go rogue and perform a malicious action is unlikely to happen as they have a stake in the project (monetary and reputation wise).
However, as this is a project that will be unleashed on launch without any further development and left to form its own ecosystem for many years to come, less centralized options should be considered.
Proof of Concept
The function ArtGobblers.upgradeRandProvider(), allows the owner to arbitrarily pass a RandProvider with the only restriction being that there is currently no seed requested from the current RandProvider:
function upgradeRandProvider(RandProvider newRandProvider) external onlyOwner {
// Revert if waiting for seed, so we don't interrupt requests in flight.
if (gobblerRevealsData.waitingForSeed) revert SeedPending();
randProvider = newRandProvider; // Update the randomness provider.
emit RandProviderUpgraded(msg.sender, newRandProvider);
}
The RandProvider is the only address eligible (as well as responsible) to call ArtGobblers.acceptRandomSeed(), which is required to perform reveals of minted Gobblers:
function acceptRandomSeed(bytes32, uint256 randomness) external {
// The caller must be the randomness provider, revert in the case it's not.
if (msg.sender != address(randProvider)) revert NotRandProvider();
// The unchecked cast to uint64 is equivalent to moduloing the randomness by 2**64.
gobblerRevealsData.randomSeed = uint64(randomness); // 64 bits of randomness is plenty.
gobblerRevealsData.waitingForSeed = false; // We have the seed now, open up reveals.
emit RandomnessFulfilled(randomness);
}
This could be abused with the consequences outlined above.
Recommended Mitigation Steps
The inclusion of a voting and governance mechanism should be considered for protocol critical functions. This could for example take the form of each Gobbler representing 1 vote, with legendary Gobblers having more weight (literally) based on the amount of consumed Gobblers.
Alex the Entreprenerd (judge) commented:
The warden has shown a few possible risks for end users, because of the privileged function
upgradeRandProvider, a malicious owner could set therandProviderto either a malicious implementation or a faulty implementation.This would prevent reveals which, as we know from other findings could cause the inability to mint legendary gobblers with non-zero emission factors.
Because this is contingent on a malicious Admin, which could deny reveals and hence deny a key aspect of the protocol, I believe Medium Severity to be appropriate
FrankieIsLost (Art Gobblers) disagreed with severity and commented:
We disagree with severity. This type of griefing attack by admin does not provide any economic benefits. Additionally, there doesn’t seem to be any viable alternatives here, as introducing a governance system just to upgrade the rand provider (which should only happen once or twice during the lifetime of the project) seems like overkill
Alex the Entreprenerd (judge) commented:
I agree with the Sponsors unwillingness to create a complex system to maintain the VRF provider.
I also must concede that griefing the mint is of dubious economic benefit.
However, per our rules and historical context I believe this is an example of Admin Privilege, the Admin can change the implementation of the Randomness Provider to their advantage and can deny the mint from continuing.
I have to agree with a nofix, beside recommending the use of a strong Multisig to avoid any issues in the future.
However, the in-scope system has no way of:
- Ensuring a multisig will be used
- Ensuring that a randomness provider which is fair is going to be used.
C4 has historically flagged these type of risks as Medium, and for those reasons I believe the correct judgement is Medium Severity.
We will be discussing these types of findings to provide consistent and transparent judging rules in the future, however, given the historical track record of C4, I believe the right move is to keep it as Medium Severity.
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 privileged function upgradeRandProvider allows the owner to set any address as the randomness provider without validation or decentralised governance.
Impact
A malicious or compromised owner could deny reveals or manipulate randomness, though this requires the owner to act against the project's interest.
What the attacker needed
Owner is malicious or compromised
The fix
The report recommends adding a voting and governance mechanism for protocol-critical functions, though the sponsor disagreed and the judge suggested using a strong multisig.
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 has an owner who can change a special contract that supplies random numbers. If the owner is malicious or makes a mistake, the random numbers can stop working or be controlled, which affects the game.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.