Skip to content
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

Is Possible onlyGovernance Lock Users Fund by Setting maxWithdrawalProcesses Over Blockchain Gas Limit #70

Closed
code423n4 opened this issue Feb 23, 2022 · 3 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/VUSD.sol#L73-L74
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/VUSD.sol#L48-L50
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/VUSD.sol#L53-L57

Vulnerability details

Impact

  1. onlyGovernance Call function setMaxWithdrawalProcesses() and Set maxWithdrawalProcesses More Than Blockchain Gas Limit
  2. Lot of users Call function withdraw() and Withdrawal Waiting List getting more and more. (Anyone can Making Multiple Small Requests to withdraw() and make the waiting list go up very fast)
while (i < withdrawals.length && (i - start) <= maxWithdrawalProcesses) {
  1. User call function processWithdrawals() but encounter gas error.

ETH Block Gas Limit = 30,000,000
ERC20 Transfer Gas Limit = 65,000

Need Only 462 simple ERC20 Token Transfer to Over Block Gas Limit.

Thus, is possible onlyGovernance Lock Users Fund by Setting maxWithdrawalProcesses Over Blockchain Gas Limit.

Proof of Concept

https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/VUSD.sol#L73-L74
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/VUSD.sol#L48-L50
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/VUSD.sol#L53-L57

Tools Used

Manual Review

Recommended Mitigation Steps

In function setMaxWithdrawalProcesses(), require input _maxWithdrawalProcesses not to More Than Blockchain Gas Limit.
require(_maxWithdrawalProcesses <= 200, 'WithdrawalProcesses Over 200');

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Feb 23, 2022
code423n4 added a commit that referenced this issue Feb 23, 2022
@atvanguard
Copy link
Collaborator

Duplicate of #40

@atvanguard atvanguard marked this as a duplicate of #40 Feb 24, 2022
@atvanguard atvanguard added the duplicate This issue or pull request already exists label Feb 24, 2022
@moose-code moose-code added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Mar 6, 2022
@moose-code
Copy link
Collaborator

Some sensible input validation could be used for this.

@JeeberC4
Copy link

Grouping with warden's QA report #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

4 participants