Description: for defender rapper perspective it is not needed to check if the msg.sender
have the _tokenId
provided because at the end of function call the required NFT is sent out to the contract. But for the challenger, they can use any _tokenId
as it does not have check if the challenger actually own the NFT.
Impact: defender role have great disadvantage for winning because challenger can use any _tokenId
with high skill and make higher chance of winning
Proof of Concept:
Alice mint _tokenId = 0
Alice call goOnStageOrBattle
function and got the defender role
Bob mint _tokenId = 1
Bob call Streets::stake
function for 4 days then unstake
his NFT rapper
Slim Shady call goOnStageOrBattle
using Bob's high skilled rapper _tokenId = 1
Alice have high chance of losing
add this to the OneShotTest.t.sol
:
The test result indicate that Slim Shady the Challenger wins even though he using Bob NFT
Recommended Mitigation:
Make sure that RapBattle::goOnStageOrBattle
check if the msg.sender
actually own the _tokenId
used.
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.