-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User can inflate the totalUnclaimedWithdrawals amount and therefore DOS the withdrawal system #24
Comments
The claiming of withdrawals completely lies on users whenever they want to claim their tokens back. The issue described is intended behaviour of protocol as the owner is expected to withdraw the tokens if they are available. In context of this competition scope, function withdraw(address /* receiver */) public view onlyOwner override {
revert(string(abi.encodePacked("Withdrawals disabled")));
} Therefore, i believe its non-issue. |
Hi @0xRizwan,
Thats exactly the issue, users can inflate the
I asked the sponsor regarding the functionality of this This issue should be valid |
@0xRizwan described it correctly. Multisig owner processes withdrawals based on the current minter balance – if there are not enough tokens to cover withdrawal request, it's not processed. @fonstack |
Hi @ilzheev Thank you for commenting,
I never disagreed with this, in fact, I agree that if there are not enough tokens it will not be processed.
I think you have misunderstood the issue here, my issue talks about the multisig owner calling totalUnclaimedWithdrawals = totalUnclaimedWithdrawals-request.amount; Which only the user can call and he will refrain from calling. Because of this multisig withdrawals will revert since everytime they call this function they will not have enough tokens to cover the withdrawal. |
@whoismxuse here is an example of token flow.
Now, There is an example how it works in production:
From documentation (to better understand how withdrawals work):
Thus multi-sig owner will unstake and add additional tokens into minter to process pending withdrawals, or deposit buffer held in the minter contract will be increased by new user deposits. |
Hi @ilzheev ! Thanks for the elaborate example, I truly appreciate it. The issue however, still stands. If the multisig owner processes a whale's withdrawal The whale can repeat this everytime more funds become available and eventually can hold the total available MANTA. Note that this is realistic since:
This reflects to roughly 3500$ as of now. a whale can easily absorb all these tokens and refrain from claiming them. This is possible since there is no force claim function that allows the multsig to claim for a user, for example, in these particular situations. |
@whoismxuse As i mentioned, withdrawals are disabled in case of inscope |
Github username: --
Twitter username: --
Submission hash (on-chain): 0xc364a37804a3b7b6c8e8d7793763a89cdd0ae40fad6ad0d86bd4be6946b58f6f
Severity: medium
Description:
Description
Function
processWithdrawals
processes the withdrawals, this function is called by theonlyOwner
, at the end theamounts
are added to thetotalUnclaimedWithdrawals
:Now whenever the user wants to claim his withdrawal he can do so by calling
claimWithdrawal
, note that this function can only be called by the owner of thewithdrawalId
:At the end of the flow ,
amount
is subtracted fromtotalUnclaimedWithdrawals
.The problem however is that the user can do the following:
requestWithdrawal
with a largeamount
processWithdrawals
is invoked and theamount
is added tototalUnclaimedWithdrawals
claimWithdrawals
resulting intotalUnclaimedWithdrawals
staying inflated with Bob'samount
withdraw
function, it will invokebalanceAvailable
which will perform the following check:totalUnclaimedWithdrawals
inflated with a highrequest.amount
the onlyOwner will be unable to make use of thewithdraw
functiononlyOwner
to callclaimWithdrawal
for a user, because of this no one is able to intervene with Bob not claimingThis essentially breaks a core functionality which is that the
onlyOwner
is unable to performwithdraw
due to a malicious user refraining from claimingRecommendation
this can easily be fixed by introducing a function that allows the
onlyOwner
to forcefully claim for a user if the user themselves refrain from doing so or even if they just forget to do so.The text was updated successfully, but these errors were encountered: