The function RamNFT.getCharacteristics(uint256 tokenId) does not check if the tokenId exists.
When we call the function RamNFT.getCharacteristics(uint256 tokenId) with an NFT tokenId, it doesn't verify whether the tokenId has been minted. Therefore, it returns inconsistent information if the tokenId does not exist.
The information returned is incorrect if the tokenId doesn't exist.
Users can use this exploit to increaseValuesOfParticipants(uint256 tokenIdOfChallenger, uint256 tokenIdOfAnyParticipant) where tokenIdOfChallenger is their own NFT ID and tokenIdOfAnyParticipant is the NextTokenId. This ensures that if they don't win, nobody will win.
This code is to be added to the smart contract Dussehra.sol#CounterTest:
Result
// This test should revert because the NFT doesn't exist
Tools Used
Manual review.
Recommendations
Check if the token exists before returning the information.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.