Badger Citadel contest - p4st13r4's results

Bringing BTC to DeFi

General Information

Platform: Code4rena

Start Date: 04/02/2022

Pot Size: $30,000 USDC

Total HM: 3

Participants: 37

Period: 3 days

Judge: leastwood

Id: 84

League: ETH

BadgerDAO

Findings Distribution

Researcher Performance

Rank: 19/37

Findings: 1

Award: $515.78

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: gellej

Also found by: Czar102, TomFrenchBlockchain, WatchPug, csanuragjain, defsec, hubble, p4st13r4, pedroais

Labels

bug
duplicate
2 (Med Risk)

Awards

515.7803 USDC - $515.78

External Links

Lines of code

https://github.com/code-423n4/2022-02-badger-citadel/blob/main/contracts/TokenSaleUpgradeable.sol#L315

Vulnerability details

Impact

The setSaleRecipient() function can change the sale recipient while a sale is open. This function can be only called by the owner of the contract, however, since:

  1. the saleRecipient is the address that receives all the input tokens deposited by users, and

  2. a comment explicitly says that this address will be citadel multisig (https://github.com/code-423n4/2022-02-badger-citadel/blob/main/contracts/TokenSaleUpgradeable.sol#L92),

this param should not be something that can be changed easily, especially not while a sale is open. In fact this opens up scenarios of funds theft by malicious contract owners

Proof of Concept

https://github.com/code-423n4/2022-02-badger-citadel/blob/main/contracts/TokenSaleUpgradeable.sol#L315

Tools Used

Editor

Add this check:

require(!finalized, "TokenSale: already finalized");

#0 - GalloDaSballo

2022-02-14T13:06:34Z

The functionality was willingly added, I believe the finding to have legitimacy but as with any admin privilege should be downgraded to medium severity

#1 - 0xleastwood

2022-03-14T11:02:29Z

Duplicate of #50

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