Skip to content
Business logic Audit finding Beginner

Users can lose access to funds due to minimum withdrawal limits

The InstantManager contract enforces a minimum withdrawal amount, so a user who withdraws part of their deposit may be left with a balance below that minimum and unable to withdraw the remainder. The user could only recover the funds by depositing more, incurring extra fees.

carrotsmuggler Follow with Breeje, 0xmystery and 3 others

Originally disclosed on Code4rena

Submitted by carrotsmuggler, also found by Breeje, 0xmystery, radev_sw, dvrkzy, and 0xCiphky

The InstantManager contract restricts deposits and withdrawals to certain minimum amounts. Users can deposit a minimum of 100k USDC tokens, and withdraw a minimum of 50k USDC tokens.

The issue is that the minimum withdrawal limit can lead to users losing access to part of their funds. Say a user deposits 100k USDC tokens and then later withdraws 60k USDC tokens. Now, the user only has 40k USDC worth holdings in their account, and cannot withdraw the full amount. This is because it falls below the minimum withdrawal limit of 50k USDC tokens. The user is now stuck with 40k USDC tokens in their account, and cannot withdraw them.

The only option the user has is to deposit 100k USDC more, and then withdraw the whole 140k USDC amount. This will incur fees on the extra 100k USDC the user brings as well. Thus this is a Medium severity issue.

Proof of Concept

The scenario can be recreated in the following steps:

  1. User ALICE deposits 100k USDC tokens.
  2. User ALICE withdraws 60k USDC tokens.
  3. User ALICE tries to withdraw 40k USDC tokens. The contract reverts, as the amount is below the minimum withdrawal limit of 50k USDC tokens.

Recommended Mitigation Steps

Allow users to remove all their funds from the contract even if it is below the minimum limit. Since the protocol now uses a more liquid system such as the BUIDL token, this should be possible and should not affect the protocol’s functioning.

3docSec (judge) commented:

I acknowledge this behavior is a design decision. However, I would keep this as a valid Medium for an audit report:

  • There is an availability impact for users, in a condition that they did not necessarily have to purposely create for themselves.
  • Users can decide to still withdraw for a loss in fees “for minting more to redeem all”.
  • The report highlights what I find to be a very reasonable mitigation - which could be the behavior users reasonably expect:

Allow users to remove all their funds from the contract even if it is below the minimum limit.

This mitigation seems feasible and difficult to exploit for systematic, abusive bypasses of minimumRedemptionAmount, because both OUSG and rOUSG have a KYC requirement on token holders.

cameronclifton (Ondo) disputed and commented:

We will not be removing minimum redemption requirement from the smart contract as there are other means in which users can redeem OUSG or rOUSG tokens from Ondo Finance.

Note: For full discussion, see here.


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

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 applies the minimum withdrawal limit to every withdrawal, including the final one that would empty the user's balance.

Impact

A user could be left with a balance below the minimum that cannot be withdrawn, forcing them to deposit more and pay extra fees to recover it.

What the attacker needed

A user account with KYC; deposit at least 100k USDC; withdraw leaving a balance below 50k

The fix

The report recommends allowing users to remove all their funds even if below the minimum limit; the project disputed this and said it will not remove the minimum redemption requirement.

How it was found

  1. User ALICE deposits 100k USDC tokens.
  2. User ALICE withdraws 60k USDC tokens.
  3. User ALICE tries to withdraw the remaining 40k USDC tokens, but the contract reverts because it is below the 50k minimum.

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.

A smart contract is a program on a blockchain that holds and moves digital money. This one only lets you take out at least 50,000 USDC at a time. If you deposit 100,000 and take out 60,000, the 40,000 left is too small to withdraw, so it is stuck unless you add more money.

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.

More by carrotsmuggler

View all

42 more disclosed reports, best first.

More from Ondo Finance

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.