Skip to content
DoS Audit finding Intermediate

Repeated approve without zero-reset can revert on nonstandard ERC20s, blocking deposits

The proxy contract approves the vault for each deposit without first resetting the allowance to zero. On tokens that reject changing a non-zero allowance to another non-zero value, a second deposit can revert, blocking deposits and bridging for that asset.

Khay3 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

52397 sc medium repeated approve without zero reset can revert on nonstandard erc20s blocking deposits

Submitted on Aug 10th 2025 at 12:13:50 UTC by @Khay3 for Attackathon | Plume Network

Description

Summary

The contract calls safeApprove(spender, amount) repeatedly without first setting the allowance to zero. Some ERC20 tokens (e.g., USDT) require resetting allowance to zero before changing a non-zero allowance; repeated deposits can therefore revert and cause a DoS of the deposit flow.

Vulnerability Detail

[TellerWithMultiAssetSupportPredicateProxy::deposit()]:

Solidity
ERC20 vault = ERC20(teller.vault());
depositAsset.safeApprove(address(vault), depositAmount);
depositAsset.safeTransferFrom(msg.sender, address(this), depositAmount);
shares = teller.deposit(depositAsset, depositAmount, minimumMint);

[TellerWithMultiAssetSupportPredicateProxy::depositAndBridge()]:

Solidity
ERC20 vault = ERC20(teller.vault());
depositAsset.safeApprove(address(vault), depositAmount);
depositAsset.safeTransferFrom(msg.sender, address(this), depositAmount);
teller.depositAndBridge{ value: msg.value }(depositAsset, depositAmount, minimumMint, data);

Impact

Users can experience transaction reverts and be unable to deposit or bridge assets that enforce zero-reset allowance semantics, resulting in effective DoS for affected assets until manual intervention or a code change fixes the allowance handling.

Recommendation

{% hint style="info" %}

  • Use a safe "reset-then-set" flow: if current allowance != 0, call safeApprove(spender, 0), then safeApprove(spender, depositAmount).
  • Alternatively, use safeIncreaseAllowance to increase the allowance by the exact needed delta and ensure the vault fully spends allowances. {% endhint %}

Proof of Concept

<details> <summary>Conditions and steps</summary>

The issue can be reproduced under these conditions:

  • A token that requires zero-first allowance semantics (for example, USDT).
  • A residual allowance remains non-zero between deposits, or the vault underspends the approved allowance.

First depositFirst deposit approves depositAmount. Vault spends less than depositAmount (or none), leaving a non-zero residual allowance.Second depositSecond deposit again calls safeApprove(spender, depositAmount) without zero-reset.RevertUSDT-like tokens revert on non-zero-to-non-zero allowance change → the second deposit call reverts.

</details>

The original report as published on Immunefi, by Khay3. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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 contract calls safeApprove with a new amount while a previous non-zero allowance may still be set, which zero-reset tokens reject.

Impact

Users could be unable to deposit or bridge affected assets, causing an effective denial of service until the allowance handling is fixed.

What the attacker needed

A zero-reset token such as USDT; a leftover non-zero allowance

The fix

The allowance should be reset to zero before setting a new amount, or increased by the exact delta with safeIncreaseAllowance.

How it was found

  1. Use a token that requires the allowance to be reset to zero first, such as USDT.
  2. Make a first deposit where the vault spends less than the approved amount, leaving a non-zero allowance.
  3. Make a second deposit, which approves the new amount without resetting to zero.
  4. The token rejects the change and the second deposit reverts.

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 directly to a new number; the permission must first be set to zero. This contract asks for a new permission each time without clearing the old one, so a leftover permission can make the next deposit fail. That means users cannot deposit that token until the code is changed.

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.

More by Khay3

View all

3 more disclosed reports, best first.

More from Plume Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.