The executeDepawsit
function currently lacks proper access control. If a user has granted approval to a malicious contract or user, the malicious entity could call executeDepawsit
and pass the approved user address as _user
, causing unintended token transfers. The function should ensure that the caller (msg.sender
) is the owner of the tokens or has explicit permission to transfer tokens on behalf of _user
.
This issue can lead to unintended token transfers, allowing malicious entities to deposit tokens from a user's account without their explicit permission, which can result in loss of funds.
Manual Review
To mitigate this issue, add a check to ensure that the caller (msg.sender
) is either the token owner or has explicit permission to transfer tokens on behalf of the user. This can be achieved by introducing access control mechanisms and using the allowance
function of the ERC20 token standard to verify permissions.
Here is an updated version of the executeDepawsit
function with the necessary access control checks:
}
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.