Art Gobblers contest - joestakey'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: 106/109

Findings: 1

Award: $55.20

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-09-artgobblers/blob/d2087c5a8a6a4f1b9784520e7fe75afa3a9cbdbe/src/utils/GobblerReserve.sol#L38

Vulnerability details

In GobblerReserve.withdraw, The ArtGobblers.transferFrom() method is used to transfer the gobblers to the recipient to. The problem is that this function does not check whether the recipient can handle ERC721 tokens, which means it could transfer Gobblers to a wallet/contract that cannot handle it, resulting in the loss/freeze of these Gobblers.

Impact

Medium

Tools Used

Manual Analysis

Mitigation

Add one more check in ArtGobblers.transferFrom()

sol
885:         require(from == getGobblerData[id].owner, "WRONG_FROM");
886: 
887:         require(to != address(0), "INVALID_RECIPIENT");
888: 
889:         require(
890:             msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id],
891:             "NOT_AUTHORIZED"
892:         );
+ require(
+           to.code.length == 0 ||
+                ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, "") ==
+                ERC721TokenReceiver.onERC721Received.selector,
+           "UNSAFE_RECIPIENT"
+        );

#0 - Shungy

2022-09-27T22:12:09Z

You have safeTransferFrom for this purpose: https://github.com/code-423n4/2022-09-artgobblers/blob/d2087c5a8a6a4f1b9784520e7fe75afa3a9cbdbe/src/utils/token/GobblersERC721.sol#L137-L141 Suggested mitigation breaks standard, introduces bugs, increases gas cost.

#2 - GalloDaSballo

2022-10-11T21:56:38Z

L

#3 - Philogy

2022-10-27T09:59:03Z

@JeeberC4 how is this not a duplicate of #322 ? The only difference seems to be the suggested mitigation

#4 - GalloDaSballo

2022-10-27T16:28:02Z

@JeeberC4 how is this not a duplicate of #322 ? The only difference seems to be the suggested mitigation

Jeeber is setting up for the QA math, it's not judging

QAs are dedouped to be added to QA reports, this is more of a backend task

See judging which is consistent between all findings marked as dups (QA - L)

TL;DR do not read into Jeeber's work it's not the same as judging

#5 - Philogy

2022-10-27T16:31:40Z

Oh my bad :sweat_smile:

Is it always just Jeeber or is there a list of who does judging / QA maths so I can keep track of things? thx again, still getting onboarded as a new backstage warden :pray:

#6 - GalloDaSballo

2022-10-27T16:38:41Z

There should always be one Judge, the rest should be taken with a grain of salt, feel free to as in Backstage if you don't know who the Judge is

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