AI Arena Mitigation Review

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.

  • Start date8 Apr 2024
  • End date18 Apr 2024
  • Total awards$21,000 in USDC
  • Duration10 days

AI Arena Mitigation Review details

Important note

Each warden must submit a mitigation review for every individual PR listed in the Scope section below. Incomplete mitigation reviews will not be eligible for awards.

Findings being mitigated

Mitigations of all High and Medium issues will be considered in-scope and listed here.

Overview of changes

  • Fixed issues with tokenId restrictions: There was an issue when re-rolling for fighters with token IDs greater than 255 which has been addressed.

  • Override fixes in safeTransferFrom

  • DNA generation fixes: Issues in the generation process during minting from the merging pool and in the re-roll and claim functions have been fixed.

  • Non-transferable GameItems fix: There was a bug that allowed non-transferable game items to be transferred, which has been fixed.

  • Mitigation of reentrancy in claimRewards: Reentrancy attack was mitigated.

  • Uninitialized numElements variable: An uninitialized variable numElements was fixed.

  • ECRecover vulnerability: A known vulnerability with ECRecover was addressed.

  • Update to ranking and staking mechanisms: There were fixes to staking requirements and an update to ranked battle contracts.

Areas of specific concern would be:

  • Reentrancy vulnerabilities.
  • Signature malleability in ECRecover.
  • Non-transferable items being transferred.

Scope

Branch

Mitigations branch

Mitigations of High & Medium Severity Issues

URLMitigation ofOriginal IssuePurpose
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/2H-01#739Fixed safeTransferFrom override with data
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/4H-02#575fixed Non-transferable GameItems being transferred with GameItems::safeBatchTransferFrom
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/10H-03#366Mitigation for Players have complete freedom to customize the fighter NFT when calling redeemMintPass and can redeem fighters of types Dendroid and with rare attributes
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/17/H-04#306
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/1H-06#68Fixed reRoll for fighters with tokenIds greater than 255
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/7H-07#45
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/6H-08#37
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/16M-03#932
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/12M-04#868Mitigation for DoS in MergingPool::claimRewards function and potential DoS in RankedBattle::claimNRN function if called after a significant amount of rounds passed.
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/11M-05A#1017Updated dna generation in reRoll and updated dna generation in claimFighters
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/3M-05B#578Fix dna generation in mintFromMergingPool
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/9M-06#137Mititgation for NFTs can be transferred even if StakeAtRisk remains, so the user's win cannot be recorded on the chain due to underflow, and can recover past losses that can't be recovered(steal protocol's token)
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/18M-08#47

Additional scope to be reviewed

These are additional changes that will be in scope.

URLMitigation ofOriginal IssuePurpose
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/5ADD-01#48Mitigated claimRewards reentrancy, fixed uninitialized numElements and fixed points intialization to match maxId
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/8ADD-02#507Fixed Ecrecover is known to be vulnerable to signature malleability
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/13ADD-03#704Mititgated QA Report for #704
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/14ADD-04#1490Mitigated unstakeNRN and setNewRound and mint upto MAX_SUPPLY
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/15ADD-05N/AAdmin setup function and new require conditions for staking and unstaking. Unstaking require correction
https://github.com/ArenaX-Labs/2024-02-ai-arena-mitigation/pull/16/commits/d81beee0df9c5465fe3ae954ce41300a9dd60b7fADD-06N/AMitigation for gas intensive setUpAirdrop function and airdrop mechanism. Missing finalized test for new airdrop mechanism but working Airdrop script based on merkle root and proof.

Out of Scope