Art Gobblers contest - 8olidity's results

Experimental Decentralized Art Factory By Justin Roiland and Paradigm.

General Information

Platform: Code4rena

Start Date: 20/09/2022

Pot Size: $100,000 USDC

Total HM: 4

Participants: 109

Period: 7 days

Judge: GalloDaSballo

Id: 163

League: ETH

Art Gobblers

Findings Distribution

Researcher Performance

Rank: 32/109

Findings: 2

Award: $525.56

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
2 (Med Risk)

Awards

470.3582 USDC - $470.36

External Links

Lines of code

https://github.com/code-423n4/2022-09-artgobblers/blob/main/src/ArtGobblers.sol#L521-L567

Vulnerability details

Impact

If the provider stops working

Proof of Concept

RequestRandomSeed () will gobblerRevealsData. WaitingForSeed set to true

Only the provider can call acceptRandomSeed () will gobblerRevealsData. WaitingForSeed set to false

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); }

However, if for some reason the Provider cannot call acceptRandomSeed(). We need to update the provider. But obblerRevealsData. WaitingForSeed = = true. We can't update it. Stuck in a loop

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); }

Tools Used

vscode

Add an emergency rescue function

Lines of code

https://github.com/code-423n4/2022-09-artgobblers/blob/main/src/ArtGobblers.sol#L733

Vulnerability details

Impact

Authentication can be improved

Proof of Concept

function gobble( uint256 gobblerId, address nft, uint256 id, bool isERC1155 ) external { // Get the owner of the gobbler to feed. address owner = getGobblerData[gobblerId].owner; // The caller must own the gobbler they're feeding. if (owner != msg.sender) revert OwnerMismatch(owner);

Tools Used

vscode

if(owner != msg.sender || !isApprovedForAll(owner, msg.sender) || getApproved(tokenId) != msg.sender) revert OwnerMismatch(owner);

#0 - csanuragjain

2022-09-28T12:27:47Z

#2 - GalloDaSballo

2022-10-08T23:58:44Z

R

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter