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
Rank: 266/283
Findings: 1
Award: $0.10
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: CodeWasp
Also found by: 0x13, 0xAlix2, 0xAsen, 0xCiphky, 0xE1, 0xLogos, 0xaghas, 0xlemon, 0xlyov, 0xvj, ADM, Aamir, BARW, Bauchibred, DMoore, DanielArmstrong, Draiakoo, Fulum, GhK3Ndf, Josh4324, Kalogerone, KmanOfficial, Krace, KupiaSec, Limbooo, MidgarAudits, MrPotatoMagic, PedroZurdo, Pelz, Tendency, _eperezok, adam-idarrha, al88nsk, alexxander, alexzoid, aslanbek, blutorque, btk, c0pp3rscr3w3r, cartlex_, cats, d3e4, deadrxsezzz, denzi_, devblixt, dimulski, erosjohn, evmboi32, fnanni, grearlake, hulkvision, immeas, israeladelaja, jaydhales, jesjupyter, jnforja, juancito, klau5, korok, ktg, ladboy233, matejdb, merlinboii, novamanbg, nuthan2x, oualidpro, peanuts, petro_1912, pkqs90, pynschon, radev_sw, rouhsamad, sashik_eth, shaka, sobieski, soliditywala, stackachu, tallo, thank_you, ubl4nk, vnavascues, web3pwn, xchen1130, zhaojohnson
0.1044 USDC - $0.10
https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L355-L365 https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L338-L348
The contract FighterFarm
manages fighter NFTs, imposing restrictions on their transfer via the _ableToTransfer
function, which is called within overridden transfer functions. These functions check that the destination address doesn't possess more than 10 NFTs and that the fighter is not staked. However, the function safeTransferFrom(from, to , tokenId, data)
lacks this override and check implementation, enabling a bypass of these restrictions.
This vulnerability allows a user to hold more than 10 fighters simultaneously and transfer a staked fighter, violating key system invariants.
safeTransferFrom(Alice, Bob , 15, "")
_ableToTransfer
is not called, so there is no check and Bob ends with 11 fighters , and a fighter that is currently at stake .vscode
override the function safeTransferFrom(from, to , tokenId, data)
in the same way you do for the other functions.
ERC721
#0 - c4-pre-sort
2024-02-23T06:03:07Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2024-02-23T06:04:34Z
raymondfam marked the issue as duplicate of #739
#2 - c4-judge
2024-03-11T02:09:27Z
HickupHH3 changed the severity to 3 (High Risk)
#3 - c4-judge
2024-03-11T02:58:17Z
HickupHH3 marked the issue as satisfactory