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

QA Report #96

Open
code423n4 opened this issue Feb 23, 2022 · 2 comments
Open

QA Report #96

code423n4 opened this issue Feb 23, 2022 · 2 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/ed1d885d5dbc2eae24e43c3ecbf291a0f5a52765/contracts/VUSD.sol#L11-L11

Vulnerability details

Use of Upgradeable Proxy Contract Structure allows the logic of the contract to be arbitrarily changed.

This allows the proxy admin to perform malicious actions e.g., taking funds from users' wallets up to the allowance limit.

This action can be performed by the malicious/compromised proxy admin without any restriction.

Considering that the purpose of this particular contract is for a token, we believe the smart contract should not be structured as an upgradeable contract.

PoC

Given:

  • reserveToken: USDC
  1. Alice approve VUSD spending her USDC and mintWithReserve() VUSD;
  2. Bob approve VUSD spending his USDC and mintWithReserve() VUSD;
  3. A malicious/compromised proxy admin can call upgradeToAndCall() on the proxy contract and set a malicious contract as newImplementation and stolen all the WBTC in Alice's and Bob's wallets;

Severity

A smart contract being structured as an upgradeable contract alone is not usually considered as a high severity risk. But given the severe impact (funds in users' wallets got stolen), with the PoC above, once the proxy admin is compromised, users' funds can be at risk. Therefore, we mark it as a High severity issue.

Recommendation

  1. Consider making the contract non-upgradeable.
  2. Consider using a non-upgradable contract to hold users' allowances.
@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Feb 23, 2022
code423n4 added a commit that referenced this issue Feb 23, 2022
@atvanguard
Copy link
Collaborator

atvanguard commented Feb 24, 2022

Duplicate of #40

@atvanguard atvanguard marked this as a duplicate of #98 Feb 24, 2022
@atvanguard atvanguard added the duplicate This issue or pull request already exists label Feb 24, 2022
@atvanguard atvanguard marked this as a duplicate of #40 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 3 (High Risk) Assets can be stolen/lost/compromised directly labels Mar 6, 2022
@JeeberC4
Copy link

Since this issue was downgraded to a QA level, and the warden did not submit a separate QA report, we've renamed this one to "QA report" for consistency.
The original title, for the record, was [WP-H1] VUSD.sol Proxy admin of the upgradeable proxy contract can steal users' reserveToken

@JeeberC4 JeeberC4 reopened this Mar 24, 2022
@JeeberC4 JeeberC4 changed the title [WP-H1] VUSD.sol Proxy admin of the upgradeable proxy contract can steal users' reserveToken QA Report Mar 24, 2022
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