SDLPool.safeTransferFrom
is not reverting if _lockId
is invalid, as expected and outlined in the comments.
The safeTransferFrom
function is expected to check the validity of _lockId
and revert in the opposite case. This is laid out clearly in the comments:
However, it does not apply since the function only checks for validity and approval of the msg.sender in the safeTransferFrom
function
and reverts if _from
is not the owner of the lock in the _transfer
function
This opens the door for an attacker to potentially exploit the issue by calling the function with an invalid or nonexistent _lockId
parameter. The function will continue to execute without catching the error due to the lack of proper checks. This can cause the amount stored in mapping(uint256 => Lock) internal locks;
and the uint256 effectiveBalanceChange
to be updated before the error is caught later on.
VsCode
The function should implement an additional if()
statement in safeTransferFrom
.
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.