Open c4-bot-5 opened 9 months ago
raymondfam marked the issue as insufficient quality report
raymondfam marked the issue as primary issue
Intended design to alleviate other constraint e.g. no more than 10 fighters per address. Low QA.
agree with the issue, the main impact is about bypassing replenishing / minting limits for a specific account by minting batteries / redeeming passes with multiple accounts & transferring all to that 1 account for consumption || transferring fighter NFTs back and forth across multiple wallets
partial credit: only mentioning bypassing of limit with multiple accounts, without stating the transfer and consumption of batteries to 1 account
HickupHH3 marked the issue as satisfactory
HickupHH3 marked the issue as selected for report
Lines of code
https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L158-L161
Vulnerability details
Impact
The mint() function in
GameItems.sol
constraints a user from minting more than 10 game items in 1 day. This constraint can easily be bypassed since a similar check is missing inside the safeTransferFrom() function:Missing check:
Note: This could also lead to a situation where a NRN whale having enough funds can buy the complete supply of the game items within minutes by using his multiple alias accounts.
Proof of Concept
Add the following inside
test/GameItems.t.sol
and run withforge test --mt test_MintGameItems_FromMultipleAccs_ThenTransfer -vv
:Tools used
Foundry
Recommended Mitigation Steps
Add the same check inside
safeTransferFrom()
too:Assessed type
Other