Skip to content
Business logic Audit finding Intermediate

Failed withdrawals from VUSD#processWithdrawals will be lost forever

When a withdrawal call fails in VUSD#processWithdrawals, the contract only emits an event and moves on, with no way to retry. As a result, the failed withdrawal amount is permanently lost.

0x52 Follow with 0xDjango, 0xpinky and 7 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-04-hubble-exchange-judging/issues/162

Found by

0x52, 0xDjango, 0xpinky, Delvir0, Kaiziron, dirk_y, kutugu, n1punp, ver0759, yy

Summary

When withdrawals fail inside VUSD#processWithdrawals they are permanently passed over and cannot be retried. The result is that any failed withdrawal will be lost forever.

Vulnerability Detail

VUSD.sol#L75-L81

        (bool success, bytes memory data) = withdrawal.usr.call{value: withdrawal.amount}("");
        if (success) {
            reserve -= withdrawal.amount;
        } else {
            emit WithdrawalFailed(withdrawal.usr, withdrawal.amount, data);
        }
        i += 1;

If the call to withdrawal.usr fails the contract will simply emit an event and continue on with its cycle. Since there is no way to retry withdrawals, these funds will be permanently lost.

Impact

Withdrawals that fail will be permanently locked

Code Snippet

VUSD.sol#L65-L85

Tool used

Manual Review

Recommendation

Cache failed withdrawals and allow them to be retried or simply send VUSD to the user if it fails.

Discussion

asquare08

will add functionality to retry withdrawals

asquare08

Fixed in this PR. The description is in the PR.

IAm0x52

Fix looks good. Failed withdrawals are cached allowing them to be retried by governance on a case by case basis.

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

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 contract does not store failed withdrawals for retry, so a failed transfer results in permanent loss.

Impact

Withdrawals that fail will be permanently locked.

What the attacker needed

A withdrawal that fails

The fix

The issue was fixed by caching failed withdrawals so governance can retry them case by case.

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 processes withdrawal requests by sending funds to users. If sending to one user fails (for example, because their address rejects the payment), the contract just notes the failure and continues. Since there is no way to try again later, that user's funds are stuck forever.

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 0x52

View all

211 more disclosed reports, best first.

More from Hubble Exchange

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.