Skip to content

Code4rena

veToken Finance contest

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

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

Disclosed reports

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

Business logic

VE3DRewardPool.sol is incompatible with Bal/veBal

The reward pool contract assumes that the staked asset and the reward token are the same, but for veBal the staked asset is an 80/20 BAL/ETH LP token while rewards are paid in BAL. If BAL is added as a supported asset, the contract will try to deposit BAL directly, which will fail and cause getReward to always revert.

veToken Finance contest

Medium
Business logic

No check for existing extraRewards during push

The reward pool contract allows the same extra reward token address to be added multiple times without a duplicate check. If a reward manager mistakenly adds the same address twice, a user who stakes and later withdraws will receive double the linked rewards, taking funds from other depositors.

veToken Finance contest

Medium
Business logic

User can lose extra rewards

The reward manager can call clearExtraRewards to remove extra reward tokens that were already staked for users, leaving those rewards permanently locked with no way for users to claim them. An attacker with the reward manager role could cause users to lose their extra rewards.

veToken Finance contest

Medium
Business logic

Deposited staking tokens can be lost if rewards token info added by mistake in addReward() in VE3DRewardPool and there is no checking to ensure this would not happen (ve3Token for one reward was equal to stacking token)

The addReward function lacks validation, so if the owner mistakenly sets a new reward token's ve3Token to an existing reward token address, then getReward will transfer the entire balance of that existing token to the caller. An attacker could then claim all staking rewards.

veToken Finance contest

Medium
Business logic

Missing sane bounds on asset weights

The contract's update function for asset weights lacks bounds checks, allowing an owner to set extreme values. This could cause the booster to mint excessive or insufficient reward tokens.

veToken Finance contest

Medium
Business logic

Booster’s shutdownPool can freeze user funds

The shutdownPool function marks a pool as shut down even if the attempt to withdraw all funds from the gauge fails. This can permanently freeze user funds because subsequent withdrawals assume the pool is already shut down and do not attempt to retrieve the funds.

veToken Finance contest

Medium
Business logic

Incorrect deployment parameters

The deployment scripts for the veToken project contained outdated addresses for G-Uni tokens, which are used to configure staking pools. An attacker could not directly exploit this, but using the wrong addresses would cause a loss of yield for users.

veToken Finance contest

Medium
DoS

ExtraRewardStashV2’s stashRewards can become unavailable

The stashRewards function transfers reward tokens without checking if the amount is zero. If a reward token reverts on zero-value transfers, the entire function fails, blocking all extra reward collection.

veToken Finance contest

Medium
DoS

VE3DLocker.sol Wrong implementation of inversely traverse for loops always reverts

The contract's inversely traversing loops, ported from a version using Solidity 0.6.12, underflow in Solidity 0.8.7 and always revert. This makes several view functions (totalSupplyAtEpoch, balanceAtEpochOf, pendingLockAtEpochOf, totalSupply) unusable, potentially breaking governance and integrations.

veToken Finance contest

Medium
Business logic

User can lose funds

If the reward token is mistakenly set to the staking token, the contract can pay out rewards using deposited funds, allowing early withdrawers to drain more than they deposited and leaving later users unable to withdraw. The report demonstrates this with a scenario where one user withdraws 105 while another is stuck.

veToken Finance contest

Medium
DoS

VE3DRewardPool claim in loop depend on pausable token

The reward pool bundles all reward tokens into a single claim loop, so if any one reward token has pausable transfers and is paused, the entire claim or withdrawal reverts. An attacker cannot directly exploit this, but a paused token (e.g., Ribbon) would block users from claiming any rewards.

veToken Finance contest

Medium
Access control

Governance can arbitrarily burn VeToken from any address

The governance token contract allows governance to burn tokens from any address, not just the caller's own balance. A malicious or compromised governance could destroy users' tokens.

veToken Finance contest

Medium
Access control

Malicious operator can rug pull

The operator role in the VoterProxy contract can call withdrawAll to remove all tokens held by the contract, and can also call execute to make arbitrary calls with any value. A malicious or compromised operator could therefore steal all tokens from the contract.

veToken Finance contest

Medium
Access control

compromised owner can drain funds from VeTokenMinter.sol

The owner of VeTokenMinter.sol can withdraw the entire contract balance to any address without delay or limit. If the owner is compromised, an attacker could drain all funds.

veToken Finance contest

Medium
Business logic

Unable To Get Rewards If Admin Withdraws $VE3D tokens From VeTokenMinter Contract

The VeTokenMinter contract's withdraw function lets the admin remove pre-minted VE3D tokens without updating internal accounting, so the mint function can later try to transfer more tokens than the contract holds, causing a revert. This revert cascades to reward claims, preventing users from receiving rewards.

veToken Finance contest

Medium
Smart contracts

in notifyRewardAmount() of VE3DRewardPool and BaseRewardPool some tokes will be locked and not distributed becasue of rounding error

The reward calculation in two reward pool contracts divides the reward amount by the duration, and integer rounding leaves a small remainder that is never distributed or recoverable. An attacker cannot directly exploit this, but the rounding error causes some reward tokens to be permanently locked in the contract.

veToken Finance contest

Medium
Smart contracts

Not updating totalWeight when operator is removed in VeTokenMinter

The VeTokenMinter contract fails to reduce totalWeight when an operator is removed, so remaining operators receive a smaller share of rewards and some rewards are never minted. An attacker cannot directly exploit this, but the misconfiguration causes unfair reward distribution.

veToken Finance contest

Medium
Business logic

Duplicate LP token could lead to incorrect deposits

The addPool function does not check for duplicate lpToken addresses, allowing two pools to share the same lpToken. When depositAll is called on the first pool, it takes all lpTokens and deposits them under its own pid, leaving no balance for the second pool.

veToken Finance contest

Medium
Access control

Owner should be allowed to change feeManager

The setFeeManager function only allows the current feeManager to change itself, so once set, the owner cannot replace a malicious feeManager. A malicious feeManager could funnel funds away, and the owner would have no way to revoke that power.

veToken Finance contest

Medium