TokenHandler.safeTransferOut does not work on non-standard compliant tokens like USDT
The TokenHandler.safeTransferOut function uses a standard IERC20 transfer call that reverts for tokens like USDT which do not return a boolean, breaking deposits for such tokens. An attacker could not exploit this directly, but it causes a denial of service for legitimate users.
Submitted by cmichel
The TokenHandler.safeTransferOut function uses the standard IERC20 function for the transfer call and proceeds with a checkReturnCode function to handle non-standard compliant tokens that don’t return a return value. However, this does not work, as calling token.transfer(account, amount) already reverts if the token does not return a return value, as token’s IERC20.transfer is defined to always return a boolean.
The impact is that, when using any non-standard compliant token like USDT, the function will revert. Deposits for these tokens are broken, which is bad as USDT is a valid underlying for the cUSDT cToken.
We recommend using OpenZeppelin’s SafeERC20 versions with the safeApprove function that handles the return value check as well as non-standard-compliant tokens.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code used a standard transfer function that expects a return value, but non-standard tokens do not return one, causing a revert.
Impact
Deposits for non-standard tokens like USDT are broken, causing a denial of service for those tokens.
What the attacker needed
Using a non-standard token like USDT
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Some tokens, like USDT, do not follow the standard way of signalling success when you transfer them. The code expected a success signal and crashed when it did not get one, so transfers with those tokens failed. This meant users could not deposit USDT.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.