Blocking of the VUSD withdrawals is possible if the reserve token doesn’t support zero value transfers
A zero-value withdrawal can be added to the VUSD withdraw queue, and if the reserve token does not support zero-value transfers, the queue processing will revert on that entry, blocking all subsequent withdrawals and freezing user funds.
Submitted by hyh
VUSD withdraw queue will be blocked and user funds frozen simply by requesting a zero value withdraw, if the reserve token doesn’t support zero value transfers.
Putting it medium only on an assumption that reserve will be USDC and the probability is low, but VUSD do allow any reserve token and the impact here is both funds freeze and stopping of the operations
Proof of Concept
It is possible to burn zero amount in OZ implementation:
So, withdraw will burn zero amount and put it to the queue:
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/VUSD.sol#L48
USDC does support zero value transfers, but not all the tokens do:
https://github.com/d-xo/weird-erc20#revert-on-zero-value-transfers
Currently VUSD can use any reserve token:
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/VUSD.sol#L33
Withdraw queue position can be modified in the processWithdrawals function only.
But it will fail every time on the zero amount entry, as there is no way to skip it (and mint VUSD back, for example), so anything else after this zero entry will not be processed:
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/VUSD.sol#L62
This way the withdrawal functionality and the corresponding user funds will be frozen within VUSD contract, which will become inoperable
Recommended Mitigation Steps
Consider adding a zero amount check, as it doesn’t cost much, while zero transfer doesn’t make sense anyway.
Now:
reserveToken.safeTransfer(withdrawal.usr, withdrawal.amount);
reserve -= withdrawal.amount;
To be:
if (withdrawal.amount > 0) {
reserveToken.safeTransfer(withdrawal.usr, withdrawal.amount);
reserve -= withdrawal.amount;
}
atvanguard (Hubble) disputed and commented:
Not an issue because reserveToken is intended to be USDC.
Not specified in spec for the audit. Giving to submitter.
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 withdrawal processing does not skip zero-amount entries, so a zero-value transfer to a token that rejects such transfers causes the entire queue processing to revert.
Impact
If the reserve token does not support zero-value transfers, the withdrawal queue is blocked and user funds are frozen; the report notes this is medium severity only under the assumption that the reserve will be USDC, which does support zero transfers.
What the attacker needed
Reserve token rejects zero-value transfers; attacker can request a zero-value withdrawal
The fix
The withdrawal processing should check that the withdrawal amount is greater than zero before attempting the transfer, so zero-value entries are skipped.
How it was found
- Request a withdrawal of zero VUSD, which burns zero amount and adds an entry to the withdraw queue.
- The zero entry remains in the queue and cannot be skipped.
- When processWithdrawals runs, it attempts a zero-value transfer to the reserve token.
- If the reserve token rejects zero-value transfers, the transfer reverts, causing the entire processing to fail.
- All withdrawals after the zero entry are blocked and user funds remain frozen.
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 user can ask to withdraw zero tokens, which gets added to a queue. When the system later tries to process that zero withdrawal, it sends zero tokens to the user. Some tokens reject zero transfers, so the whole processing stops and everyone else's withdrawals are stuck.
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.