AI Arena - m4ttm'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: 282/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/5b2ab9f9fadd0b91268ff6f22b4ae0fd5b79ec09/src/GameItems.sol#L301-L302

Vulnerability details

Impact

GameItems uses the transferable parameter to disable the ability to transfer a token, however it is only checked in the overriden implementation of safeTransferFrom. The existing safeBatchTransferFrom method can still be used to bypass this check. https://github.com/code-423n4/2024-02-ai-arena/blob/5b2ab9f9fadd0b91268ff6f22b4ae0fd5b79ec09/src/GameItems.sol#L301-L302

## Proof of Concept Add the following to https://github.com/code-423n4/2024-02-ai-arena/blob/5b2ab9f9fadd0b91268ff6f22b4ae0fd5b79ec09/test/GameItems.t.sol

function testBypassTransferability() public {
        _fundUserWith4kNeuronByTreasury(_ownerAddress);
        _gameItemsContract.mint(0, 2);
        _gameItemsContract.adjustTransferability(0, false);
        uint256[] memory ids = new uint256[](1);
        uint256[] memory amounts = new uint256[](1);
        ids[0] = 0;
        amounts[0] = 2;
        _gameItemsContract.safeBatchTransferFrom(_ownerAddress, address(1), ids, amounts, "");
    }

## Tools Used

Manual Review

## Recommended Mitigation Steps Override safeBatchTransferFrom and check the transferable of every id in the batch.

Assessed type

Access Control

#0 - c4-pre-sort

2024-02-22T04:46:16Z

raymondfam marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-02-22T04:46:22Z

raymondfam marked the issue as duplicate of #18

#2 - c4-pre-sort

2024-02-26T00:29:58Z

raymondfam marked the issue as duplicate of #575

#3 - c4-judge

2024-03-05T04:58:37Z

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