VTVL contest - romand'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: 153/198

Findings: 1

Award: $18.86

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

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

Vulnerability details

Impact

Admin can lock himself out of contract, which makes any actions with onlyAdmin modifier impossible.

Proof of Concept

  it("admin disables himself", async function () {
    const [owner] = await ethers.getSigners();

    const contract = await deployVestingContract();

    expect(await contract.isAdmin(owner.address)).to.equal(true);
    await (await contract.connect(owner).setAdmin(owner.address, false)).wait();
    expect(await contract.isAdmin(owner.address)).to.equal(false);
  });

Tools Used

VS Code

Add check in AccessProtected.sol setAdmin function

    function setAdmin(address admin, bool isEnabled) public onlyAdmin {
        require(admin != address(0) && admin != msg.sender, "INVALID_ADDRESS");
        _admins[admin] = isEnabled;
        emit AdminAccessSet(admin, isEnabled);
    }

#0 - 0xean

2022-09-23T23:30:32Z

closing as dupe of #469

#1 - 0xean

2022-10-09T23:10:08Z

downgraded to QA

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