Boot Finance contest - leastwood'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: 10/28

Findings: 4

Award: $1,086.67

🌟 Selected for report: 2

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: nathaniel

Also found by: WatchPug, leastwood, pauliax

Labels

bug
duplicate
3 (High Risk)

Awards

529.9131 USDC - $529.91

External Links

Handle

leastwood

Vulnerability details

Impact

The Vesting.vest() function is called by airdrop/investor distributions to lock 70% of their token allocations for a period of one year. Vestings are defined on a linear schedule and can be claimed as often as the user likes. However, the _claimableAmount() function iterates over the list of vestings for a particular user to calculate claimable tokens. As a result, a malicious user could call vest() multiple times with an arbitrarily small amount and effectively deny airdrop/investor distributions. If the number of tokens to be distributed is significant, it may prove useful for other recipients to deny these users from receiving their tokens in order to increase the purchasing power of their own holdings. I categorise this issue as high risk due to potential loss of investor/airdrop holdings.

Proof of Concept

https://github.com/code-423n4/2021-11-bootfinance/blob/main/vesting/contracts/Vesting.sol#L73-L98 https://github.com/code-423n4/2021-11-bootfinance/blob/main/vesting/contracts/Vesting.sol#L162-L188

Tools Used

Manual code review. Discussions with dev.

Ideally avoid iterating over a list of vestings or alternatively force the user to define a list of indexes that point to which vestings they would like to claim. Additionally, it may prove useful to also prevent the vest() function from being called by any contract besides AirdropDistribution.sol and InvestorDistribution.sol.

#0 - chickenpie347

2021-11-16T14:21:28Z

Addressed in #120

Findings Information

🌟 Selected for report: gpersoon

Also found by: WatchPug, cmichel, hyh, leastwood, pauliax

Labels

bug
duplicate
2 (Med Risk)

Awards

85.8459 USDC - $85.85

External Links

Handle

leastwood

Vulnerability details

Impact

The onlyOwner role typically calls revoke() if a member leaves the BootFinance team, resulting in vested tokens being transferred to the multisig account. Each vesting account has a revocable state variable that is set to either true or false. As any user can arbitrarily call vest() it may prove useful for team members to protect their vestings by calling vest() where _isRevocable is set to 0, thereby preventing the onlyOwner role from calling revoke(). This is unintended as it limits the functionality of revoke(), hence I would make this issue medium risk.

Proof of Concept

https://github.com/code-423n4/2021-11-bootfinance/blob/main/vesting/contracts/Vesting.sol#L73-L98 https://github.com/code-423n4/2021-11-bootfinance/blob/main/vesting/contracts/Vesting.sol#L104-L137

Tools Used

Manual code review.

Consider preventing benRevocable from being changed if a user calls the vest() function again. Ideally, if the vest() function is limited to the airdrop/investor distribution contracts and a multisig account, it should prevent any malicious behaviour from users attempting to game the Vesting.sol contract.

#0 - chickenpie347

2021-11-16T13:57:19Z

Addressed in #132.

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