AI Arena - 0xlamide'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: 243/283

Findings: 1

Award: $0.56

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L462-L474

Vulnerability details

Impact

Once the generation of a specific fighter type is increased,new fighter cannot be created for such fighter type

Proof of Concept

This issue occurs because numElement state for newly created generation is not updated https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L85 when the generation of a specific fighter type is incremented https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L129-L134 . This cause the numElement of the incremented generation to 0 by default, thereby causing _createFighterBase https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L462-L474 to always revert at this point https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L470 for such when creating a new fighter

Tools Used

Manual review

numElement[] of generation of fighter type should be updated when increment generation in the incrementGeneratiion()

Assessed type

Context

#0 - c4-pre-sort

2024-02-22T18:57:57Z

raymondfam marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-02-22T18:58:12Z

raymondfam marked the issue as duplicate of #45

#2 - c4-pre-sort

2024-02-22T18:58:40Z

raymondfam marked the issue as insufficient quality report

#3 - raymondfam

2024-02-26T01:52:23Z

Inadequate elaboration.

#4 - c4-judge

2024-03-08T03:16:44Z

HickupHH3 marked the issue as partial-50

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