frxETHMinter: Non-conforming ERC20 tokens not recoverable
The contract's token recovery function assumes every token returns a boolean on transfer, so tokens like USDT that return nothing cause the call to revert. An attacker cannot exploit this, but accidentally sent non-conforming tokens become permanently stuck.
Submitted by Lambda, also found by 0x1f8b, 0x5rings, 0xSky, 0xSmartContract, 8olidity, brgltd, Chom, CodingNameKiki, hansfriese, IllIllI, m9800, magu, pashov, pedroais, peritoflores, prasantgupta52, rokinot, Ruhum, seyni, and Sm4rty
There is a function recoverERC20 to rescue any ERC20 tokens that were accidentally sent to the contract. However, there are tokens that do not return a value on success, which will cause the call to revert, even when the transfer would have been successful. This means that those tokens will be stuck forever and not be recoverable.
Proof Of Concept
Someone accidentally transfers USDT, one of the most commonly used ERC20 tokens, to the contract. Because USDT’s transfer does not return a boolean, it will not be possible to recover those tokens and they will be stuck forever.
Recommended Mitigation Steps
Use OpenZeppelin’s safeTransfer.
FortisFortuna (Frax) commented:
Not really medium risk. Technically you could use safeTransfer, but if someone were to accidentally send something to this contract, it would most likely be either ETH, FRAX, frxETH, or sfrxETH, all of which are transfer compliant.
I think this qualifies as a Medium risk. Sponsor has created functionality to recover ERC20 tokens. Wardens have shown a path to which this functionality does not work correctly.
2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.
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 recovery function calls the token's transfer directly and requires a boolean return value, instead of using a safe transfer helper that tolerates tokens returning nothing.
Impact
Tokens that do not return a boolean, such as USDT, would be stuck forever if sent to the contract; the sponsor notes that accidental transfers would most likely be compliant tokens, and the judge rated it Medium.
What the attacker needed
Someone sends a non-conforming token to the contract
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 follow an older standard where a transfer does not report success with a true/false value. The recovery function expects that value, so it fails and the tokens cannot be moved out. This is a design flaw, not an attack, and it only matters if someone sends such a token to the contract by mistake.
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.