Boot Finance contest - nathaniel's results

Custom DEX AMM for Defi Projects

General Information

Platform: Code4rena

Start Date: 04/11/2021

Pot Size: $50,000 USDC

Total HM: 20

Participants: 28

Period: 7 days

Judge: 0xean

Total Solo HM: 11

Id: 51

League: ETH

Boot Finance

Findings Distribution

Researcher Performance

Rank: 16/28

Findings: 3

Award: $683.86

🌟 Selected for report: 3

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: nathaniel

Also found by: WatchPug, leastwood, pauliax

Labels

bug
3 (High Risk)
sponsor confirmed

Awards

529.9131 USDC - $529.91

External Links

Handle

nathaniel

Vulnerability details

Impact

The timelocks for any beneficiary are unbounded, and can be vested by someone who is not the beneficiary. When the array becomes significantly big enough, the vestments will no longer be claimable for the beneficiary.

The vest() function in Vesting.sol does not check the beneficiary, hence anyone can vest for anyone else, pushing a new timelock to the timelocks[_beneficiary]. The _claimableAmount() function (used by claim() function), then loops through the timelocks[_beneficiary] to determine the amount to be claimed. A malicious actor can easy repeatedly call the vest() function with minute amounts to make the array large enough, such that when it comes to claiming, it will exceed the gas limit and revert, rendering the vestment for the beneficiary unclaimable. The malicious actor could do this to each beneficiary, locking up all the vestments.

Proof of Concept

https://github.com/code-423n4/2021-11-bootfinance/blob/main/vesting/contracts/Vesting.sol#L81 https://github.com/code-423n4/2021-11-bootfinance/blob/main/vesting/contracts/Vesting.sol#L195 https://github.com/code-423n4/2021-11-bootfinance/blob/main/vesting/contracts/Vesting.sol#L148

Tools Used

Manual code review

  • Create a minimum on the vestment amounts, such that it won't be feasible for a malicious actor to create a large amount of vestments.
  • Restrict the vestment contribution of a beneficiary where require(beneficiary == msg.sender)
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