Skip to content

Code4rena

Yieldy contest

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

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

Disclosed reports

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

DoS

Denial of Service by wrong BatchRequests.removeAddress logic

The removeAddress function used delete instead of properly removing an array element, leaving a zero address in the array. This could cause a denial of service because the contract would later try to call canBatchContracts on address(0).

Yieldy contest

High
Smart contracts

Unsecure transferFrom

The transferFrom function checks only the allowance, not the actual credit balance, so a user could transfer more than their credit balance and cause an underflow in the subtraction. This could allow the attacker to create credits out of thin air or break the contract's accounting.

Yieldy contest

Medium
Business logic

Arbitrage on stake()

The stake function calls rebase before depositing, allowing a user to deposit just before a rebase and then instantly unstake to capture rewards without burning the yield token. This can increase the profit distributed on the next rebase and disrupt rewards for other holders.

Yieldy contest

Medium
Business logic

Withdrawals initiated after cycle withdrawal request won’t be withdrawn in the correct cycle

A smart contract allows only one withdrawal request per cycle, so withdrawals initiated after the request but before the cycle ends are recorded but not actually processed. This causes a mismatch between tokens withdrawn and tokens users are allowed to withdraw, meaning some eligible users cannot withdraw due to insufficient tokens.

Yieldy contest

Medium
Business logic

Inconsistent balance when fee-on transfer tokens.

The staking contract records the token balance after a safe transfer, which can be lower than the amount actually staked if the token charges a transfer fee. An attacker could exploit this to cause an inconsistent accounting of staked balances.

Yieldy contest

Medium
Business logic

Incorrect rebase percentage calculation

When a rebase would push the total supply above the maximum, the code caps the supply but still passes the full profit to the rebase storage function, so the rebase percentage is calculated on an amount that was not fully applied. This could misreport the rebase percentage, though the maximum supply is so large it is unlikely to be reached.

Yieldy contest

Medium
Business logic

token transfers in LiquidityReserve and Staking contract don’t support deflationary ERC20 tokens, and user funds can be lost if stacking token was deflationary

The contracts stake and addLiquidity functions transfer tokens from the user and assume the full amount is received, but if the token is deflationary (charges a fee on transfer), the contract receives less than the requested amount while still minting or crediting the full amount to the user. This can cause other stakers to lose funds because the user receives more than they contributed.

Yieldy contest

Medium
DoS

Removal of liquidity from the reserve can be griefed

A user can prevent others from withdrawing liquidity from the LiquidityReserve by making a small instant unstake that sets a non-zero cooldown amount, causing the unstakeAllRewardTokens function to skip unstaking. This can lock funds until the cooldown expires or the contract is paused.

Yieldy contest

Medium
Business logic

Incorrect withdrawal requested

The withdrawal function calculated a capped amount but then requested the uncapped amount from the Tokemak pool, so when the balance was lower than the requested amount, the contract asked to withdraw more than it held. An attacker could trigger this to request an excessive withdrawal, potentially causing a failure or draining more than intended.

Yieldy contest

Medium
Business logic

Staking preSign could use some basic validations

The preSign function accepts any orderUid without validating its contents, so the owner could sign an order with an arbitrary receiver and other parameters. This could act as a rug vector, allowing the owner to redirect funds or set unfavourable terms.

Yieldy contest

Medium
Business logic

coolDown & warmUp period do not work when a low _firstEpochEndTime is passed to initialize

The staking contract's constructor did not check that the first epoch end time was in the future, so a very low or zero value could be passed. An attacker could then call rebase repeatedly to push the epoch number forward and bypass the warm-up and cool-down waiting periods before claiming or withdrawing.

Yieldy contest

Medium
Business logic

instantUnstake fee can be avoided

The instantUnstake fee calculation rounds down, allowing users to avoid the fee by unstaking small amounts in a loop. An attacker could unstake tokens without paying the liquidity provider fee, though only in small increments per call.

Yieldy contest

Medium
Access control

Burn access control can be bypassed

The transferFrom function does not check if the recipient address is the zero address, allowing tokens to be burned without calling the burn function. This bypasses the access control that restricts burning to the MINTER_BURNER_ROLE.

Yieldy contest

Medium
Business logic

Cannot mint to exactly max supply using _mint function

The smart contract's minting function uses a strict less-than check against the maximum supply, so it reverts when the total supply equals the max. An attacker could not exploit this; it is a functional bug that prevents minting the final token.

Yieldy contest

Medium
Business logic

MINIMUM_LIQUIDITY checks missing - Bringing Liquidity below required min

The contract lacks a check to ensure that after a liquidity provider withdraws, the remaining liquidity stays above the MINIMUM_LIQUIDITY threshold. A large liquidity provider could remove all their funds, leaving the pool below the required minimum, which the report says is incorrect.

Yieldy contest

Medium
Business logic

No withdrawal possible for ETH TOKE pool

The withdraw function of the ETH Tokemak pool has an extra parameter asEth, unlike other pools, so when the staking token is ETH/WETH, withdrawals are impossible and funds become locked.

Yieldy contest

High
DoS

Staking.sol#stake() DoS by staking 1 wei for the recipient when warmUpPeriod > 0

The stake function allows anyone to specify an arbitrary recipient, and when the warm-up period is greater than zero, a tiny deposit resets the recipient's warm-up expiry. An attacker could repeatedly push back the expiry for any user, preventing them from claiming their staked tokens.

Yieldy contest

High
Business logic

Yield of LiquidityReserve can be stolen

The yield from LiquidityReserve is distributed instantly when a user calls instantUnstakeReserve, and liquidity can be added and removed without penalty. An attacker could sandwich the user's call by adding liquidity before and removing it after, thereby capturing most of the fee that would otherwise go to existing liquidity providers.

Yieldy contest

High
DoS

It’s possible to perform DOS and fund lose in Stacking by transferring tokens directly to contract

The Staking contract's rebase function calls Yieldy.rebase with a profit derived from the contract's token balance, and if the ratio of rebasing credits to updated total supply becomes zero the call reverts. An attacker could send tokens directly to the Staking contract to make that ratio zero, causing most Staking functions to revert, or make it very low so rounding errors lose user funds.

Yieldy contest

Medium
DoS

Possible DOS (out-of-gas) on loops.

The contract's batch functions iterate over an unbounded array of contracts, so if many contracts are pending withdrawal the loop can run out of gas and the transaction fails. An attacker could add many contracts to make the function unusable.

Yieldy contest

Medium
Business logic

Rebases can be frontrun with very little token downtime even when warmUpPeriod > 0

A user can stake just before an epoch ends, bypassing the forced rebase in the stake function, then immediately unstake in the next block to collect the rebase rewards without staying staked. This allows the user to get in, collect the rebase, and get out with minimal token downtime.

Yieldy contest

Medium
Business logic

Users of Migration.sol may forfeit rebase rewards

The migration function calls instantUnstake with the rebase flag set to false, so any pending rebase is skipped. A user migrating funds at that moment would forfeit the rewards from that pending rebase.

Yieldy contest

Medium
DoS

Sending batch withdrawal requests can possibly DoS

The batch withdrawal function loops over an unbounded list of contracts, so if many contracts are added, the transaction can exceed the block gas limit and fail. An attacker could potentially cause a denial of service by making the list too large, though only the owner can add contracts.

Yieldy contest

Medium
Business logic

_storeRebase() is called with the wrong parameters

The contract's rebase function passed the updated total supply to an internal event-storing function instead of the previous circulating supply. As a result, the emitted rebase event recorded the wrong previous value, so the event data did not reflect the actual change.

Yieldy contest

Medium
Business logic

Staking: rebase() does not rebase according to the status of the current epoch.

The rebase function in the staking contract applies the current epoch's reward distribution before recalculating it, so the rewards used for an epoch are stale. This can cause rewards to be updated incorrectly and lead to an incorrect distribution of user rewards.

Yieldy contest

Medium