Token ownership check during the raffle initialization is meaningless #192
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-88
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2022-12-forgeries/blob/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L126
Vulnerability details
Impact
It is not guaranteed that the raffle owner is the actual owner of the token up for a raffle.
Proof of Concept
And whenever a new raffle is created,
msg.sender
is used for initialization and it is checked if the caller is actually the owner of the token.From this, I believe that the protocol intended to guarantee that the raffle owner actually owns the token up for a raffle.
But this guarantee can be easily broken by transferring the ownership of the raffle.
This means a user can create unlimited number of raffles for the same token and transfer ownership to others.
Although the other owners can not start a draw, the impact might differ according to the business logic in the sense of how the ownership of a raffle for a token is valued.
I believe this is not what the protocol intended.
Tools Used
Manual Review
Recommended Mitigation Steps
Consider locking the NFT token during the initialization.
The text was updated successfully, but these errors were encountered: