Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

n1punp - VUSD's withdrawal request can be skipped if reserve has not enough balance at the moment of processing --> Users can get DoS #3

Closed
sherlock-admin opened this issue Jul 3, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Jul 3, 2023

n1punp

high

VUSD's withdrawal request can be skipped if reserve has not enough balance at the moment of processing --> Users can get DoS

Summary

VUSD's withdrawal request can be skipped if reserve has not enough balance at the moment of withdrawal processing

Vulnerability Detail

processWithdrawals function will loop through each withdrawal request made, and will try to process if there's sufficient remaining balance. However, if the balance is insufficient, a fail event will be emitted and the request will simply be skipped (and will never be re-processed again).

Impact

  • The withdrawal request made can be frontrunned by other users --> it's possible that every time the user who wanted to withdrawal can always be frontrunned so that the remaining balance is always insufficient -> cannot withdraw forever.

Code Snippet

https://github.com/sherlock-audit/2023-04-hubble-exchange/blob/main/hubble-protocol/contracts/VUSD.sol#L79

Tool used

Manual Review

Recommendation

Possible mitigations are:

  1. always ensure balance is available for withdraw, or
  2. re-queue the failed ones (append the withdrawal request if the request fails instead of just skipping).

Duplicate of #162

@github-actions github-actions bot added High A valid High severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jul 10, 2023
@sherlock-admin2 sherlock-admin2 added the Reward A payout will be made for this issue label Jul 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

2 participants