Did not Approve to zero first
The contract calls ERC20 approve directly on tokens such as USDT that revert when the existing allowance is not zero, so the approval step can fail. An attacker cannot exploit this directly, but legitimate transfers through the bridge could be blocked.
HonorLt Follow with Ruhum, Saeedalipoor01988 and 6 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2023-01-derby-judging/issues/36
Found by
HonorLt, Ruhum, Saeedalipoor01988, SunSec, chainNue, hyh, koxuan, martin, tsvetanovv
Summary
Vulnerability Detail
Some ERC20 tokens like USDT require resetting the approval to 0 first before being able to reset it to another value. The ohm.approve, pairToken.approve, pool.approve function does not do this - unlike OpenZeppelin's safeApprove implementation.
Impact
unsafe ERC20 approve that do not handle non-standard erc20 behavior. 1.Some token contracts do not return any value. 2.Some token contracts revert the transaction when the allowance is not zero.
Code Snippet
// This contract approves transfer to Connext
IERC20(_token).approve(address(connext), _amount);
Tool used
Manual Review
Recommendation
It is recommended to set the allowance to zero before increasing the allowance and use safeApprove/safeIncreaseAllowance.
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
Likely the code calls the raw ERC20 approve function instead of a safe helper that first zeroes the allowance and checks the return value.
Impact
Approvals for non-standard tokens such as USDT could revert, blocking the intended transfer; the text does not claim any theft or direct attacker gain.
What the attacker needed
Token behaves like USDT on approve; existing non-zero allowance
The fix
The allowance should be set to zero before it is increased, using safeApprove or safeIncreaseAllowance.
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, such as USDT, refuse to change an existing spending permission unless it is first set back to zero. This contract skips that reset step, so the approval call can fail and the transfer cannot go ahead. It is a reliability bug rather than a way for someone to steal funds.
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.