Skip to content

Code4rena

Vader Protocol contest

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

disclosed reports
117
most reported class
Business logic
bug classes found
6
first disclosure
2021
Find Vader Protocol contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Vader Protocol contest chose to make public.

Business logic

previousPrices Is Never Updated Upon Syncing Token Price

The LiquidityBasedTWAP contract never updates the stored previousPrices for VADER or USDV after initial setup, so the liquidity evaluation always uses the initial price instead of the current synced price. This causes the TWAP to diverge from market prices, potentially favouring on-chain or off-chain data incorrectly.

Vader Protocol contest

High
Business logic

VaderPoolV2.mintFungible exposes users to unlimited slippage

The mintFungible function in VaderPoolV2 allows users to provide liquidity without specifying a minimum number of LP tokens to receive. A frontrunner can manipulate the pool's reserves to cause the liquidity provider to receive fewer LP tokens than they should, extracting up to 100% of the provided value.

Vader Protocol contest

Medium
Business logic

VaderReserve.reimburseImpermanentLoss improperly converts USDV to VADER

The VaderReserve contract's reimburseImpermanentLoss function incorrectly converts an amount denominated in USDV to VADER by dividing by usdvPrice, which is unrelated to the VADER price. This causes the reserve to pay out an incorrect amount of VADER once a USDV price reading exists.

Vader Protocol contest

Medium
Smart contracts

Vader TWAP averages wrong

The syncVaderPrice function skips initialising weights for pairs whose update window has not been reached, leaving pastLiquidityWeights entries at zero and making totalLiquidityWeight inconsistent with the sum of individual weights. An attacker can call syncVaderPrice twice in the same block to set totalLiquidityWeight to zero, causing price functions to revert and breaking minting and reimbursement.

Vader Protocol contest

High
Audit finding

Oracle returns an improperly scaled USDV/VADER price

The LBT oracle fails to account for the difference in decimal scaling between Chainlink prices and the protocol's expected 18-decimal format, so a USDV-DAI pair trading at parity returns a price of 1e8 instead of 1e18. An attacker could exploit the mispriced oracle to mint or burn USDV and VADER at incorrect rates, draining protocol funds.

Vader Protocol contest

High
DoS

Denial of service

On the first deposit into a new token pair, the pool sets total liquidity units to the native deposit amount, which can be as low as 1. An attacker can exploit this to make one liquidity token represent the entire pool reserves, causing rounding errors that prevent or disadvantage new liquidity providers and potentially allow the attacker to profit.

Vader Protocol contest

High
Business logic

USDV.sol Mint and Burn Amounts Are Incorrect

The USDV.mint and USDV.burn functions calculate token amounts incorrectly because they use a single price feed instead of the correct ratio, leading to either the protocol or the user losing funds.

Vader Protocol contest

High
Business logic

LPs of VaderPoolV2 can manipulate pool reserves to extract funds from the reserve.

The impermanent loss protection in VaderPoolV2 calculates losses based on current pool reserves, which an LP can manipulate via flashloan to engineer a large IL payout from the reserve. An attacker could then remove liquidity, receive compensation, and re-add liquidity, potentially draining the reserve.

Vader Protocol contest

High
Business logic

Adding pair of the same foreignAsset would replace oracle of earlier entry

Oracles were stored keyed only by the foreign asset rather than by the specific trading pair, so adding a new pair for an asset that already had one silently overwrote the oracle used by the earlier pair. An attacker or careless admin adding a pair could therefore change the price source for an existing pair unexpectedly.

Vader Protocol contest

Medium
Audit finding

Oracle can be manipulted to consider only a single pair for pricing

The oracle values each pool's liquidity by multiplying reserves by a price, and an attacker could skew a single pair's reserves with a flash loan so that pool appears to hold an arbitrarily large amount. That would make all other pairs contribute negligibly, so if a Chainlink feed for one asset were faulty the oracle could be forced to price from that one pool.

Vader Protocol contest

Medium
Access control

Council veto protection does not work

The veto function in the Vader governance contract checks the wrong data to detect proposals that would remove the council, so the council can veto any attempt to replace them and remain in power indefinitely.

Vader Protocol contest

High
Business logic

Using single total native reserve variable for synth and non-synth reserves of VaderPoolV2 can lead to losses for synth holders

The pool used a single total native reserve variable for both synth minters and liquidity providers, so when a non-synth LP exited they could withdraw native assets deposited by synth minters. A large enough LP exit could leave synth minters with substantially less native asset than they deposited, causing losses for synth holders.

Vader Protocol contest

High
Access control

VaderPoolV2 owner can steal all user assets which are approved VaderPoolV2

The owner of the VaderPoolV2 contract could call a function that takes tokens from any address that had approved the contract, and direct the resulting liquidity NFT to themselves. This let the owner take custody of all user assets approved to the pool.

Vader Protocol contest

High
Crypto

Oracle doesn’t calculate USDV/VADER price correctly

The oracle contract calculates the USDV price by averaging prices expressed in different foreign assets without converting them to a common unit, producing an invalid value. An attacker could exploit this incorrect price to mint or burn USDV at a favourable rate, causing the protocol to lose funds.

Vader Protocol contest

High
Business logic

Reserve does not properly apply prices of VADER and USDV tokens

The reserve contract multiplied the impermanent-loss amount by an oracle price that is stored as a fixed-point number, without converting it back to a normal integer. Depending on which branch ran, the payout could be 1e18 times too large or too small, so the reserve could pay out far more than it should and lose funds.

Vader Protocol contest

High
Business logic

totalLiquidityWeight Is Updated When Adding New Token Pairs Which Skews Price Data For getVaderPrice and getUSDVPrice

When a new token pair is added, the total liquidity weight for VADER is increased immediately, but the per-pair liquidity weights used in price synchronisation are not updated until the next sync. If syncVaderPrice is called before the new pair's update period has passed, the total weight is inflated while the individual weights are underrepresented, skewing the calculated price for VADER and USDV.

Vader Protocol contest

High
DoS

No way to remove GasThrottle from VaderPool after deployment

The pool contract applies a gas-price check on every swap using a value from an external gas oracle, and the throttle cannot be disabled after deployment. If that oracle were compromised to return zero, all swaps would fail permanently with no recovery path.

Vader Protocol contest

Medium
Business logic

Unclear TwapOracle.consult algorithm

The TWAPOracle.consult function's algorithm is unclear and appears to compute an average price by summing foreign token pair prices and dividing by summed USD prices, which weights large prices more heavily. An attacker could potentially manipulate the oracle by skewing pool prices of low-priced pairs without significantly affecting the final result.

Vader Protocol contest

Medium
Business logic

Governor’s veto protection can be exploited

The GovernorAlpha contract's veto mechanism fails to block proposals that include a call to the contract itself, allowing a malicious proposer to bypass the council's veto by appending an innocent self-call. An attacker could thus circumvent the veto procedure, making the council unable to veto.

Vader Protocol contest

Medium
Business logic

Tokens with fee on transfer are not supported

The pool's mint function assumes the received token amount equals the transfer amount, which is incorrect for fee-on-transfer tokens. An attacker could deposit such a token and receive more liquidity units than deserved, diluting other liquidity providers.

Vader Protocol contest

Medium
Business logic

add liquidity is vulnerable to sandwich attack

The addLiquidity function in the VaderRouter and VaderRouterV2 contracts did not check a minimum liquidity amount, so a user's deposit could be sandwiched by an attacker who trades around it. An attacker could buy the token before the victim's transaction and sell back afterwards to profit from the price movement.

Vader Protocol contest

Medium
Smart contracts

LinearVesting does not calculate vested amount linearly

The linear vesting contract calculates the claimable amount incorrectly, so after a partial claim the user receives less than the correct linear share. An attacker or user could claim less than entitled, but the text does not describe an exploit to steal funds.

Vader Protocol contest

Medium
Business logic

User may not receive the full amount of IL compensation

The Vader protocol's impermanent loss compensation function caps the payout at the reserve balance without letting the user specify a minimum acceptable amount. An attacker could exploit this via MEV to cause the user to receive less compensation than expected.

Vader Protocol contest

Medium
Business logic

Missing duplicate veto check

The veto function in GovernorAlpha does not check if a proposal has already been vetoed, allowing the council to veto the same proposal multiple times. This could lead to repeated veto actions, potentially causing unintended state changes such as multiple queue calls.

Vader Protocol contest

Medium
Access control

BasePool.swap() Is Callable By Anyone

The BasePool.swap() function lacks an onlyRouter modifier, allowing anyone to call it directly and bypass the input validation performed by VaderRouter._swap(). An attacker could potentially exploit this to perform swaps without the necessary checks.

Vader Protocol contest

Medium
Audit finding

TWAPOracle.getRate does not scale the ratio

The TWAPOracle.getRate function performs integer division without scaling, causing the rate to be zero when the numerator is smaller than the denominator. This leads to incorrect values in the usdvtoVader and vaderToUsdv functions.

Vader Protocol contest

Medium
Audit finding

Incorrect Accrual Of sumNative and sumUSD In Producing Consultation Results

The TwapOracle.consult() function incorrectly sums native and USD prices separately before combining them, producing an incorrect price. An attacker could exploit this to manipulate the oracle's output, potentially affecting protocol actions that rely on it.

Vader Protocol contest

High