Skip to content

Code4rena

Popcorn contest

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

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

Disclosed reports

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

Smart contracts

Any user can drain the entire reward fund in MultiRewardStaking due to incorrect calculation of supplierDelta

The reward index calculation multiplies by the staking token's decimals but divides by the reward token's decimals, so when the two tokens have different decimal places the reward amount is inflated by a large factor. An attacker could claim an enormous reward, draining the entire reward fund, or at minimum cause a denial of service where no one can withdraw.

Popcorn contest

High
Business logic

Lost Rewards in MultiRewardStaking Upon Third-Party Withdraw

When an approved third party withdraws staked assets on behalf of the owner to a different receiver, the contract fails to accrue rewards for the owner, causing the owner's earned staking rewards to be permanently lost. An attacker with approval could trigger this loss by withdrawing to themselves, though the owner's principal is returned.

Popcorn contest

High
Access control

Attacker can deploy vaults with a malicious Staking contract

The vault deployment function accepts any staking contract address without checking it against approved templates. An attacker can deploy a vault with a malicious staking contract that has a backdoor to withdraw all deposited funds, leading users to lose funds.

Popcorn contest

High
Access control

Modifier VaultController._verifyCreatorOrOwner does not work as intented

The VaultController contract's _verifyCreatorOrOwner modifier uses a logical OR instead of AND, so it only allows access when the caller is both creator and owner. This blocks legitimate creators and owners from calling several functions, including deployVault with staking rewards.

Popcorn contest

High
Business logic

Total assets of yearn vault are not correct

The YearnAdapter contract calculates the total assets of a Yearn vault by adding the vault's token balance to its total debt, but the Yearn vault itself uses an internal tracked value (totalIdle) instead of the live balance. This can cause the adapter to overstate total assets if the vault's balance is inflated, leading to incorrect share price calculations.

Popcorn contest

Medium
Access control

Adapters logic contracts can be destroyed

The logic contracts behind upgradeable adapter contracts could be destroyed by calling their initializer directly and then triggering a delegatecall to a malicious contract that self-destructs. This would render all adapter instances inoperable.

Popcorn contest

Medium
Access control

VaultController() Missing call DeploymentController.nominateNewDependencyOwner()

The VaultController's setDeploymentController function swaps the stored deployment controller but never calls the old controller's nominateNewDependencyOwner, so ownership of the clone factory and registries is never handed over. As a result, switching to a new deployment controller cannot complete properly.

Popcorn contest

Medium
Business logic

Vault.redeem function does not use syncFeeCheckpoint modifier

The Vault.redeem function lacks the syncFeeCheckpoint modifier that withdraw uses, so highWaterMark is not updated after redemption. This can cause performance fees to be calculated incorrectly, either overpaying or underpaying the fee recipient.

Popcorn contest

Medium
Business logic

vault.changeAdapter can be misused to drain fees

The vault's changeAdapter function could be called by any user even after the owner had already set the adapter, causing the vault to withdraw and redeposit all funds into the same fee-charging adapter. Repeated calls would incur withdrawal fees each time, leading to a direct loss of user assets.

Popcorn contest

Medium
Race condition

erc777 cross function re-entrancy

The vault contract mints shares before transferring the underlying asset, and if that asset is an ERC777 token, its transfer callback allows an attacker to re-enter a different minting function. This lets the attacker obtain twice as many shares as the assets they actually deposit.

Popcorn contest

Medium
Business logic

Vault fees can be set to anything when initializing

The vault's initialize function accepts any fee values without validation. If fees are set to 1e18 or higher, functions like withdraw can fail due to division by zero or arithmetic overflow.

Popcorn contest

Medium
DoS

DOS any Staking contract with Arithmetic Overflow

A vault creator could attach their vault to any existing staking contract and add 255 reward tokens, causing the staking contract's reward-accrual loop to overflow a uint8 counter. Any deposit, withdrawal, transfer or claim on that staking contract would then revert, locking all staked funds.

Popcorn contest

Medium
Business logic

Vault.maxWithdraw returns asset amount that is too big for Vault.withdraw

The Vault's maxWithdraw function returns the maximum assets that can be withdrawn according to the adapter, but it does not account for the withdrawal fee that withdraw adds by increasing the required shares. An upstream contract that uses maxWithdraw's return value as input to withdraw will always revert because the fee pushes the required shares above the user's balance.

Popcorn contest

Medium
Business logic

Vault::takeFees can be front run to minimize accruedPerformanceFee

The vault's performance fee is calculated from a high-water mark that is updated on every deposit, mint, or withdraw. An attacker can front-run fee collection with a dust deposit or withdrawal to reset the high-water mark and eliminate the accrued performance fee.

Popcorn contest

Medium
Business logic

quitPeriod is effectively always just 1 day

The vault's quit period, meant to give users time to exit before fee or adapter changes, can be shortened by the owner after a change is proposed. An owner can propose a change, wait one day, reduce the quit period to one day, and then apply the change immediately, denying users the expected waiting time.

Popcorn contest

Medium
Business logic

Vault creator can prevent users from claiming staking rewards

The vault creator can set the escrow fee recipient to the zero address, causing reward claims to revert when a fee is charged. This locks user rewards and lets the creator later claim them by setting the fee to zero when no other stakers are present.

Popcorn contest

Medium
Business logic

Users can fail to withdraw deposited assets from a vault that uses YearnAdapter contract as its adapter because maxLoss input for calling corresponding Yearn vault’s withdraw function cannot be specified

The YearnAdapter contract calls the Yearn vault's withdraw function without specifying the maxLoss parameter, so the default 0.01% loss tolerance is used. If the Yearn vault's strategies incur a loss greater than 0.01%, the withdraw call reverts, preventing users from withdrawing their deposited assets.

Popcorn contest

Medium
Business logic

cool down time period is not properly respected for the harvest method

The harvest cooldown was not enforced because the lastHarvest timestamp was never updated after a harvest, so the strategy was called on every deposit or withdrawal. An attacker could repeatedly trigger harvest calls, defeating the intended rate limit.

Popcorn contest

Medium
Smart contracts

AdapterBase should always use delegatecall to call the functions in the strategy

The AdapterBase contract calls strategy verification and setup functions directly instead of using delegatecall, so the strategy contract's context is used and the calls fail because the strategy does not implement the adapter interface. This prevents creating a vault with that strategy, and if setup succeeds partially, later harvest calls may fail due to invalid settings.

Popcorn contest

Medium
Business logic

Incorrect Reward Duration After Change in Reward Speed in MultiRewardStaking

When the reward speed in MultiRewardStaking is changed, the new end time is computed from the contract's full reward-token balance rather than the tokens still owed to users. This lets some users keep earning rewards past the intended period and can leave the contract unable to pay what it owes others.

Popcorn contest

High
Business logic

Owner can collect management fees with a new increased fee for previous time period.

The vault owner can change the management fee and then collect fees for a past period using the new higher rate, because the timestamp of the last fee update is not reset when the fee changes. This lets the owner charge more than intended for time when a lower or zero fee was active.

Popcorn contest

Medium
Smart contracts

The calculation of takeFees in Vault contract is incorrect

The Vault contract mints fee shares using a conversion that divides by the pre-fee asset total, so the fee recipient receives fewer shares than the fee is worth. An attacker (or any user) benefits because the fee charged is less than expected, diluting the fee recipient's entitlement.

Popcorn contest

Medium