Pool Credit Line May Not Able to Start When _borrowAsset is Non ERC20 Compliant Tokens
The start() function in the LenderPool contract uses IERC20.transfer to send a fee, which will revert for tokens like USDT that do not return a boolean value. This prevents the credit line from starting when such tokens are used as the borrowed asset.
Originally disclosed on Code4rena
Submitted by Meta0xNull, also found by Dravee and kenta
IERC20(_borrowAsset).transfer(_to, _fee);
If the USDT token is supported as _borrowAsset, the unsafe version of .transfer(_to, _fee) may revert as there is no return value in the USDT token contract’s transfer() implementation (but the IERC20 interface expects a return value).
Function start() will break when _borrowAsset is USDT or Non ERC20 Compliant Tokens. USDT is one of the most borrowed Asset in DEFI. This may cause losing a lot of potential users.
Proof of Concept
Recommended Mitigation Steps
Use .safeTransfer instead of .transfer
IERC20(_borrowAsset).safeTransfer(_to, _fee);
Shifted from transfer to safeTransfer sublime-finance/sublime-v1#372
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 contract uses the standard IERC20.transfer function, which expects a boolean return value, but tokens like USDT do not return a value, causing the call to revert.
Impact
The start() function will break for USDT or other non-ERC20 compliant tokens, potentially losing many potential users.
What the attacker needed
Borrowed asset is USDT or similar token
The fix
The fix is to use safeTransfer instead of transfer, which handles tokens that do not return a boolean.
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 ERC20 rule that requires a transfer function to return a true or false value. The smart contract expects that return value, so when it calls transfer on USDT, the call fails and the whole function stops. This means users cannot start a loan if the borrowed token is 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.