VTVL contest - cryptphi's results

Building no-code token management tools to empower web3 founders and investors, starting with token vesting.

General Information

Platform: Code4rena

Start Date: 20/09/2022

Pot Size: $30,000 USDC

Total HM: 12

Participants: 198

Period: 3 days

Judge: 0xean

Total Solo HM: 2

Id: 164

League: ETH

VTVL

Findings Distribution

Researcher Performance

Rank: 102/198

Findings: 2

Award: $27.95

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-09-vtvl/blob/main/contracts/AccessProtected.sol#L39-L43

Vulnerability details

Impact

The AccessProtected.setAdmin() allows for admin to Set/unset Admin Access for a given address. However it is possible for contracts' admin privileged functions to no longer callable when all admins are unset. A single admin can maliciously unset every other admins including themselves and lock the critical admin functions making some functions in AccessProtected, VariableSupplyERC20Token, VTVLVesting contracts revert.

Above can also get funds locked in VTVLVesting contract.

Proof of Concept

  1. Alice is an admin
  2. Alice calls AccessProtected.setAdmin with address of an admin and isEnabled as false
  3. All admins are unset
  4. Alice also unset herself as an admin
  5. All admins are no longer enabled
  6. VariableSupplyERC20Token.mint() would revert whenever a previously enabled admin calls the function.
  7. Non contract controlled ERC20 tokens are also locked as they can no longer be withdrawn from VTVLVesting contract

Tools Used

Manual review

Whilst it is possible to have an admin disable other admins, it may be necessary to have a check that an admin does not disable themselves. Alternatively, owner of the contract may have a higher privilege over setAdmin() function in such a way that access to admin functions can be recovered by AccessProtected contract owner

#0 - 0xean

2022-09-23T23:42:56Z

dupe of #469

#1 - 0xean

2022-10-09T23:04:31Z

downgrading to QA

Awards

9.086 USDC - $9.09

Labels

bug
G (Gas Optimization)

External Links

The use of _msgSender() when there is no implementation of a meta transaction mechanism that uses it, such as EIP-2771, very slightly increases gas consumption. Currently, there is no provision for EIP-2271 implemented.

Replace _msgSender() with msg.sender if there is no mechanism to support meta-transactions like EIP-2771 implemented.

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter