AI Arena - 0xprinc's results

In AI Arena you train an AI character to battle in a platform fighting game. Imagine a cross between Pokémon and Super Smash Bros, but the characters are AIs, and you can train them to learn almost any skill in preparation for battle.

General Information

Platform: Code4rena

Start Date: 09/02/2024

Pot Size: $60,500 USDC

Total HM: 17

Participants: 283

Period: 12 days

Judge:

Id: 328

League: ETH

AI Arena

Findings Distribution

Researcher Performance

Rank: 281/283

Findings: 1

Award: $0.00

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L289-L303 https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC1155/ERC1155.sol#L120-L132

Vulnerability details

Impact

Game Items that are not transferable can be transfered.

Proof of Concept

The function safeTransferFrom() in GameItems.sol includes a validation check:

require(allGameItemAttributes[tokenId].transferable);

This check is designed to prevent the transfer of items marked as non-transferable. However, there exists another method for transferring items, safeBatchTransferFrom(), found in ERC1155.sol, which GameItems.sol inherits. Since GameItems.sol does not override safeBatchTransferFrom(), it inadvertently allows for the transfer of items regardless of their transferable status.

Tools Used

Manual Review

To address this issue, it is recommended to override the safeBatchTransferFrom() function in GameItems.sol to include the same transferability check:

require(allGameItemAttributes[tokenId].transferable);

Assessed type

Token-Transfer

#0 - c4-pre-sort

2024-02-22T04:36:23Z

raymondfam marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-02-22T04:36:56Z

raymondfam marked the issue as duplicate of #18

#2 - c4-pre-sort

2024-02-26T00:29:40Z

raymondfam marked the issue as duplicate of #575

#3 - c4-judge

2024-03-05T04:58:09Z

HickupHH3 marked the issue as satisfactory

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