CompoundToNotionalV2.enableToken ERC20 missing return value check
The enableToken function calls ERC20.approve() but ignores the boolean return value. Tokens that return false on failed approval are still treated as approved, so the contract may proceed as if approval succeeded when it did not.
Submitted by cmichel
The enableToken function performs an ERC20.approve() call but does not check the success return value. Some tokens do not revert if the approval failed, returning false instead.
The impact is that, tokens that don’t actually perform the approve and return false are still counted as a correct approve.
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 does not check the boolean return value of ERC20.approve(), so a false return is treated as success.
Impact
Tokens that return false on a failed approval are still counted as correctly approved, potentially allowing operations that should have been blocked.
What the attacker needed
Token returns false instead of reverting
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.
When a smart contract asks a token for permission to spend your tokens, the token is supposed to reply with a true or false. This code ignores that reply. If the token says false (meaning 'no'), the contract still acts as if it said yes, which could lead to unexpected behaviour.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.