Skip to content

Code4rena

Anchor contest

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

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

Disclosed reports

Newest first. Only what Anchor contest chose to make public.

Business logic

bEth Rewards May Be Depleted By Flashloans or Whales

The reward distribution logic updates a global index based on the current total balance, so a user who suddenly increases their balance can capture a disproportionate share of rewards. An attacker could flashloan or buy a large amount of wormhole ETH, convert it to bEth, trigger a reward update, claim rewards, and then convert back, gaining rewards without contributing to the system.

Anchor contest

Medium
Smart contracts

Sandwich attack on astroport sweep

The collector contract allows anyone to call a sweep function that swaps asset tokens to ANC through Astroport without setting a belief price or ensuring a maximum spread. An attacker could sandwich this trade to profit at the protocol's expense, causing the protocol to receive fewer tokens than at a fair market price.

Anchor contest

Medium
Business logic

Possible Wrong bAsset Rewards/Borrow limits Calculation

The contract's reward and borrow limit calculations rely on configuration values that are updated without recalculating the epoch operations, leaving stale data. An attacker could potentially exploit this to obtain incorrect rewards or borrow limits.

Anchor contest

Medium
Smart contracts

Staking tokens can be stolen

The staking contract calculates shares to burn when withdrawing tokens by rounding down, allowing an attacker to withdraw more tokens than the shares they burn. An attacker can repeatedly exploit this rounding error to make a small profit.

Anchor contest

Medium
Business logic

anchor_basset_reward pending yields can be stolen

The reward contract updates a user's balance without first settling pending rewards, so a new depositor's larger balance is multiplied by rewards that belong to existing users. An attacker could bond a large amount, trigger a global index update, and claim a disproportionate share of pending yield, potentially amplified with a flash loan.

Anchor contest

Medium
Business logic

Updating the hub’s token contract address may lead to incorrect undelegation amount

The hub contract allows the admin to update the token contract address, which can cause incorrect undelegation amounts because the amount of unbonded tokens is stored as requested_with_fee. An attacker with admin privileges could change the token contract and cause users to receive wrong amounts during undelegation.

Anchor contest

Medium
Business logic

Unbonding validator random selection can be predicted

The unbonding function chose which validator to unstake from using a random number seeded only by the block height, which is predictable. An attacker could repeatedly bond to their own validator and unbond when the predictable choice favoured them, eventually capturing all Anchor bond stake and rewards.

Anchor contest

Medium
Business logic

Potential lock of rewards in the custody contracts

The custody contract's swap function only handles the reply when the last sub-message succeeds, so if that swap fails, the swapped rewards remain stuck in the contract. An attacker could not directly exploit this, but users may be unable to receive rewards during periods when the last swap consistently fails.

Anchor contest

Medium
Business logic

Spend limit on owner can be bypassed

The owner's spend limit in the distributor and community contracts was never reduced after a spend, so the limit was not enforced. An owner could call the spend function repeatedly, each time for the full limit, and move far more than intended.

Anchor contest

High
Audit finding

Simple interest calculation is not exact

The borrow interest was calculated using a simple interest formula rather than compound interest, so the actual rate depended on how often the market was updated. In low-activity markets, this could lead to a lower borrow rate and suppliers losing out on interest.

Anchor contest

Medium