Closed code423n4 closed 1 year ago
Finding is valid but in the codebase _executeERC20Approve
is only used in a onlyOwner
function here so there is no break of functionality: the owner can just approve 0 and reapprove.
0xhiroshi marked the issue as sponsor disputed
Invalid: we will just do 2 approvals if needed.
Lines of code
https://github.com/code-423n4/2022-11-looksrare/blob/e42ac05b3b740292422a725e9b57687e62d32c67/contracts/lowLevelCallers/LowLevelERC20Approve.sol#L25
Vulnerability details
Proof of Concept
Some tokens (e.g. USDT, KNC) do not allow approving an amount M > 0 when an existing amount N > 0 is already approved. Since the code in
LowLevelERC20Approve::_executeERC20Approve
does not first approve zero allowance, this functionality will revert with the above mentioned tokens.Impact
The impact is that calls to
_executeERC20Approve
will revert when the allowance is non-zero and the token has such a protection mechanism, hence Medium severityRecommendation
When using
ERC20::approve
always approve 0 allowance first so the protocol is compatible with USDT and other such tokens