A Malicious attacker can set themselves as an operator by calling the setApprovalForAll()
function and transfer User Tokens/ Locks.
By calling the setApprovalForAll()
function, an attacker can set themselves up as the operator which will be updated in the operatorApprovals
mapping and the isApprovedForAll()
function returns the malicious operator stored in the mapping when called.
As you can see below;
This isApprovedForAll()
function is returned when isApprovedOrOwner()
function is called as the function returns either the owner or the operator.
The isApprovedOrOwner()
function is then used in the transferFrom()
function to validate if an operator is approved before transferring Users lock.
In this case, the check will pass and the malicious will be able to perform the transfer.
An attacker can easily transfer a user lock which is not intended design
Manual code review
Grant "only" the msg.sender
(the owner of the lock id) access to the setApprovalForAll()
function
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.