Art Gobblers contest - KIntern_NA'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: 24/109

Findings: 1

Award: $1,858.21

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
3 (High Risk)

Awards

1858.2053 USDC - $1,858.21

External Links

Lines of code

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

Vulnerability details

[2022-09-artgobblers] Forgetting to delete approval can help attacker mint any legendary gobbler with 0 cost of standard gobblers.

tags: c4, 2022-09-artgobblers, high

Affected code

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

Impact

When mint new lengendary gobbler, an amount of standard gobblers (cost) must be burned. But when batch burn gobblers in function mintLegendaryGobbler(), contract has not delete the approval of these gobblers. So after mint legendary gobbler, attackers can take back the gobblers which must be burned if they approved these gobblers to other address before.

Proof of concept

Tools Used

Manual review Foundry

Add delete approval of gobblers when batch burn in function mintLegendaryGobbler():

for (uint256 i = 0; i < cost; ++i) {
    id = gobblerIds[i];

    if (id >= FIRST_LEGENDARY_GOBBLER_ID) revert CannotBurnLegendary(id);

    require(getGobblerData[id].owner == msg.sender, "WRONG_FROM");

    burnedMultipleTotal += getGobblerData[id].emissionMultiple;

    emit Transfer(msg.sender, getGobblerData[id].owner = address(0), id);
    
    delete getApproved[id]; // delete the approval of gobbler
}
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