Skip to content

Code4rena

Venus Prime

Every publicly disclosed report for Venus Prime and what kind of bugs they were.

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

Disclosed reports

Newest first. Only what Venus Prime chose to make public.

Access control

The owner is a single point of failure and a centralization risk

The report notes that several privileged functions in a smart contract are guarded only by an owner check, so a single externally owned account holding that role would be a centralisation risk and single point of failure. An attacker who obtained that private key, or a holder who lost it, could compromise or lock the contract's administrative actions.

Venus Prime

Medium
DoS

DoS and gas griefing of calls to Prime.updateScores()

The updateScores function in the Prime contract fails to increment the loop counter when a user's score is already updated, causing an infinite loop and out-of-gas revert. An attacker can front-run a legitimate updateScores call with a call that updates one of the same users, causing the original call to revert and delaying score updates.

Venus Prime

Medium
Business logic

Scores.sol: Incorrect computation of user’s score when alpha is 1

The score calculation for a staked user returns zero whenever either the staked XVS balance or the supplied capital is zero, even when the alpha weighting parameter is set to 1. This means a user who only stakes XVS and supplies no capital would incorrectly receive a score of zero instead of the full staking-based score.

Venus Prime

Medium
Business logic

Potential Unjust Liquidation After Exiting Market

The preLiquidateHook and preSeizeHook functions do not check whether a borrower has exited a market, so a liquidator can seize collateral from a market the user has disabled. This could lead to unjust liquidation of assets that the user no longer considers collateral.

Venus Prime

Medium
Smart contracts

ShortFall contract might transfer an incorrect amount of tokens to the highest bidder.

The ShortFall auction contract computes the amount owed to the highest bidder in USD terms but then transfers that same number of convertibleBaseAsset tokens directly, without converting through the price oracle. If the base asset is not pegged to USD, the winner could receive far more value than intended.

Venus Prime

Medium
Business logic

placeBid() Possible participation in auctions that have been modified

The placeBid function identifies an auction only by the comptroller address, so if the auction is restarted before a bid transaction is mined, the bid applies to the new auction instead of the one the user intended. This could cause the user to pay a large debt for little seized risk fund.

Venus Prime

Medium
Business logic

Incorrect blocksPerYear constant in WhitepaperInterestRateModel

The WhitePaperInterestRateModel contract uses a blocksPerYear constant of 2102400, which assumes a 15-second block time, but Venus Protocol runs on BNB Chain with 3-second blocks. This makes the per-block interest rate five times higher than intended, causing borrowers to pay excessive interest and distorting market incentives.

Venus Prime

High
Business logic

liquidateAccount will fail if the transaction is not included in the current block

The liquidateAccount function requires the repaid amount to exactly equal the borrower's borrow balance, which grows every block as interest accrues. A liquidator whose transaction lands in a later block than expected will have the call revert, so liquidations fail and must be retried.

Venus Prime

Medium
DoS

_ensureMaxLoops causes liquidateAccount to fail in certain conditions

The `_ensureMaxLoops` function reverts if the iteration count exceeds `maxLoopsLimit`, but `liquidateAccount` may require more orders than the limit allows, preventing liquidation of an underwater account. An attacker could exploit this by creating a position that cannot be liquidated, potentially causing bad debt.

Venus Prime

Medium
Business logic

Bad Debt in PoolLens.sol#getPoolBadDebt() is not calculated correctly in USD

The getPoolBadDebt view function in PoolLens multiplies a market's bad debt by the oracle price without dividing by 1e18, unlike the equivalent calculation in Shortfall. This makes the reported bad debt in USD massively inflated compared with the correct value.

Venus Prime

Medium
Smart contracts

Exchange Rate can be manipulated

The report claims that an attacker can manipulate the exchange rate of a Venus VToken by directly transferring underlying tokens to the contract, which inflates the exchange rate and could allow the attacker to borrow beyond the collateral factor and earn more rewards. The sponsor disputed most of the impact, arguing that the donation benefits all existing vToken holders and that the attacker would be better off simply minting more tokens.

Venus Prime

Medium
Business logic

Fix utilization rate computation

The utilization rate calculation in a smart contract can return a value greater than 1 when reserves exceed cash, because the formula does not handle that case. This could lead to incorrect interest rate calculations.

Venus Prime

Medium