Open c4-bot-10 opened 9 months ago
raymondfam marked the issue as primary issue
raymondfam marked the issue as sufficient quality report
Unsigned integer type limitation indeed.
brandinho (sponsor) confirmed
Mitigated here
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/FighterFarm.sol#L370
Vulnerability details
Impact
FighterFarm:: reRoll
uses uint8 for nft id as input, which will stop people calling this function who owns id greater than 255.It will lead to not being able to use the reRoll to get random traits, which could have been better for there game performance.Proof of Concept
Affect code can be seen here
Adding code snippet below as well, for better clarity
If you notice the highlighted line (first line of function), it takes
uint8
as input fortokenId
parameter. Which will restrict users to call this function when they own nft id greater than 255.value will go out of bounds when user will input 256 or more.
Tools Used
Manual Review
Recommended Mitigation Steps
use uint256 for nft id input to fix the issue.
Assessed type
DoS