Skip to content

Code4rena

Badger Citadel contest

Every publicly disclosed report for Badger Citadel contest and what kind of bugs they were.

disclosed reports
11
most reported class
Business logic
bug classes found
3
first disclosure
2022
Find Badger Citadel contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Badger Citadel contest chose to make public.

Business logic

StakedCitadel: wrong setupVesting function name

The StakedCitadel contract calls a vesting function named setupVesting, but the actual vesting contract only exposes a function called vest. As a result, the withdraw function reverts and users cannot withdraw their tokens.

Badger Citadel contest

High
Business logic

Stale price used when citadelPriceFlag is cleared

When an oracle price falls outside the valid range, the contract sets a flag but does not store the new price. If the policy operations team later clears the flag, the contract continues using the stale price from before the flag, allowing the team to influence pricing without oracle coordination and potentially causing incorrect asset valuations and loss of funds.

Badger Citadel contest

Medium
Business logic

New vest reset unlockBegin of existing vest without removing vested amount

The vesting contract resets the unlock schedule when new tokens are vested, but does not reset the claimed amount, so a user who has already claimed some tokens can have their claimable balance underflow and revert. This locks their previously vested tokens until the new schedule completes.

Badger Citadel contest

Medium
Race condition

Guaranteed citadel profit

The mintAndDistribute function increases the price of a staking share, allowing a user to deposit before the call and withdraw after to profit from the price increase. An attacker could sandwich the function to take a portion of the distributed citadels, reducing other users' profits.

Badger Citadel contest

Medium
Race condition

KnightingRound tokenOutPrice changes

The buy function uses the current tokenOutPrice without allowing the buyer to specify a maximum acceptable price, so a price change by governance can be included before the buyer's transaction, causing the buyer to pay an unexpected price. An attacker could also front-run the price change to exploit this.

Badger Citadel contest

Medium
Business logic

Funding.deposit() doesn’t work if there is no discount set

The Funding contract's deposit function calls getAmountOut, which returns zero when no discount is set, causing a later depositFor call to revert because it requires a non-zero amount. As a result, no deposits are possible unless a discount is configured.

Badger Citadel contest

Medium
Business logic

StakedCitadel doesn’t use correct balance for internal accounting

The StakedCitadel contract's balance() function returns only the vault's token balance, not the vault plus strategy balance, so share minting and burning use an incorrect denominator. An attacker can deposit a small amount to make the balance non-zero and then deposit more to receive far more shares than deserved, allowing them to withdraw more tokens than they should.

Badger Citadel contest

High
Business logic

Owner can steal input tokens

The contract owner could change the token sale price while a buyer's purchase transaction was pending, so the buyer received far fewer tokens than expected and the owner's chosen recipient address received the tokens. The owner could also front-run a buy to set a very high price, effectively giving the buyer almost nothing.

Badger Citadel contest

Medium
Business logic

saleRecipient can rug buyers

The buy function transfers the buyer's input tokens directly to the saleRecipient without first ensuring the corresponding output tokens are locked in the contract. A malicious saleRecipient can keep the input tokens and finalize the sale without ever providing the output tokens, causing buyers to lose their funds.

Badger Citadel contest

Medium
Business logic

The Owner and Proxy Admin can make users lose funds (“rug vectors”)

The smart contract gives the owner and proxy admin excessive control, allowing them to change sale conditions, pause the contract, sweep unsold tokens, and front-run buyers, which can cause buyers to lose funds. The proxy admin can also upgrade the contract to steal all funds.

Badger Citadel contest

Medium