Closed sherlock-admin closed 2 years ago
The recommendation is significantly impacting the applicability of the contract and business flow.
Malicious tokens can safeTransferFrom() results
this lacks example of how this would allow to steal funds. Yes, user can do something with his/her own malicious token, but he could make the same play in e.g. Uniswap.
The contract also does not check the soundness of _token
Example of soundness check would be appreciated, otherwise it is of little practical value.
8olidity
medium
Malicious tokens can safeTransferFrom() results
Summary
Malicious tokens can safeTransferFrom() results
Vulnerability Detail
In the CardTopupPermit() function, _token is passed in by the user and can be a malicious ERC20 token forged by the attacker
The _token is then put into the _processTopup function
Here, a malicious _token can implement a fake safeTransferFrom function, such as no transfer but return a successful transfer. The contract also does not check the soundness of _token. Cause loss of contracted assets.
Impact
Malicious tokens can safeTransferFrom() results
Code Snippet
https://github.com/sherlock-audit/2022-10-mover/blob/main/cardtopup_contract/contracts/HardenedTopupProxy.sol#L331
Tool used
Manual Review
Recommendation
Example Set the token whitelist