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:
- User ALICE deposits 100k
USDCtokens. - User ALICE withdraws 60k
USDCtokens. - User ALICE tries to withdraw 40k
USDCtokens. The contract reverts, as the amount is below the minimum withdrawal limit of 50kUSDCtokens.
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.
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 bothOUSGandrOUSGhave 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.
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
- User ALICE deposits 100k USDC tokens.
- User ALICE withdraws 60k USDC tokens.
- 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.