Skip to content

Code4rena

Y2k Finance contest

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

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

Disclosed reports

Newest first. Only what Y2k Finance contest chose to make public.

Business logic

Depeg event can happen at incorrect price

The depeg trigger condition in the smart contract used a strict less-than comparison, so a depeg event could be triggered when the asset price was exactly equal to the strike price, contrary to the documented requirement that it be below. An attacker could call the trigger function at the equal price to cause the vaults to swap assets prematurely.

Y2k Finance contest

High
Audit finding

A design flaw in the case of using 2 oracles (aka PegOracle)

The PegOracle design treats both assets in a pair symmetrically, so a depeg event can be falsely triggered if the underlying asset (e.g., WBTC or USDC) deviates from its canonical value, even when the tracked asset (e.g., renBTC or MIM) remains stable. An attacker could exploit this to cause incorrect depeg events, potentially leading to indirect loss of assets.

Y2k Finance contest

High
Business logic

StakingRewards.sol#stake is intended to be pausable but isn’t

The StakingRewards contract inherits a pausable base but never exposes any external function to pause or unpause it, so the whenNotPaused modifier on stake has no effect. An attacker could continue staking even when the owner intends to pause the contract.

Y2k Finance contest

Medium
Audit finding

StakingRewards: Significant loss of precision possible

The reward rate per second is calculated with rounding down, which over a long duration can cause a large portion of intended rewards to remain undistributed. An attacker could exploit this to cause stakers to lose a significant amount of rewards.

Y2k Finance contest

Medium
Business logic

StakingRewards.sol#notifyRewardAmount() Improper reward balance checks can make some users unable to withdraw their rewards

The notifyRewardAmount function only checks that the contract's current reward token balance covers the new reward rate, ignoring rewards already owed to users but not yet withdrawn. If the rewards distributor calls notifyRewardAmount again without sending new tokens, the contract can become insolvent, causing users' getReward calls to fail.

Y2k Finance contest

Medium
Access control

Griefing attack on the Vaults is possible, withdrawing the winning side stakes

The withdraw functions in the vault contracts check that the receiver is approved by the owner, rather than the caller. This allows anyone to trigger a withdrawal for an owner who has approved any address, potentially causing the owner to lose their payout if timed just before the epoch ends.

Y2k Finance contest

High
Business logic

Fees are taken on risk collateral

The withdrawal function charges a fee on the entire collateral deposited by risk users, not just on premiums and payouts. This could discourage risk users from providing collateral because fees may exceed their profits.

Y2k Finance contest

Medium
Business logic

StakingRewards reward rate can be dragged out and diluted

The StakingRewards contract's notifyRewardAmount function recalculates the reward rate by spreading the remaining rewards plus any new deposit over a fresh rewardsDuration period. A malicious actor could call notifyRewardAmount with zero rewards to repeatedly dilute the reward rate and drag out rewards for all stakers.

Y2k Finance contest

Medium
Audit finding

Different Oracle issues can return outdated prices

The oracle contract's timestamp check only verifies that the timestamp is not zero, so it accepts prices that are years old. An attacker could exploit this to use outdated prices, potentially causing economic losses.

Y2k Finance contest

Medium
Access control

It’s possible to change for Vault and lost control on it

The VaultFactory contract allows an admin to set a new Controller for a market without verifying that the new Controller's VaultFactory address matches the current VaultFactory. This mismatch causes the Controller to be unable to locate the market's vaults, so functions like triggerDepeg and triggerEndEpoch fail, resulting in a loss of functionality.

Y2k Finance contest

Medium
Business logic

Fee-on-Transfer tokens cause problems in multiple places

The vault and controller contracts do not account for tokens that charge a fee on transfer, so the vault mints more shares than the assets received and later attempts to send the full balance fail. This can leave the last users unable to withdraw and prevent the end of an epoch from being triggered.

Y2k Finance contest

Medium
Audit finding

Oracle is tracked per token instead of per pair, leading to surprise results

The protocol stores oracles keyed only by a single token rather than by the token pair, so when a new pair is created with a different oracle, the assignment is silently skipped and the old oracle is reused. This can produce incorrect price comparisons for the new pair, leading to wrong results if the assets move relative to each other.

Y2k Finance contest

Medium
Business logic

Rewards are not rolled over

Rewards distributed during periods with no deposits are not rolled over and remain stuck in the contract. An attacker could potentially withdraw these stuck rewards if the sweeper function is available, but the report does not claim direct theft.

Y2k Finance contest

Medium
Smart contracts

Vault.sol is not EIP-4626 compliant

The Vault contract does not fully implement the EIP-4626 tokenised vault standard: it lacks the mint and redeem functions, its max* functions do not return zero when deposits or withdrawals are disabled, previewDeposit ignores fees, and totalAssets omits assets paid out during a depeg or at epoch end. Other protocols integrating with Y2K may wrongly assume compliance, which could cause integration problems and potentially loss of funds.

Y2k Finance contest

High
Audit finding

Incorrect handling of pricefeed.decimals()

The oracle contract incorrectly scales price feed values based on the feed's decimals, assuming 8 decimals. For feeds with other decimal counts, the returned price is wrong by orders of magnitude or zero, which could break depeg detection and market creation.

Y2k Finance contest

High