Part of CertiK’s series
CertiK reviewed Venus Protocol (Venus - Isolated Pools) on 19 Jun 2023: 44 findings, 1 critical; 38 marked fixed, 6 open.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 1 |
| High | 2 | 0 | 7 |
| Medium | 0 | 0 | 4 |
| Low | 4 | 0 | 26 |
### Shortfall.sol In the contract `Shortfall`, the role `onlyOwner()` has the authority over the function `updatePoolRegistry()`. Any compromise to the `onlyOwner` account may allow the hacker to take advantage of this authority and update the `poolRegistry` contract address. In addition, the role `DEFAULT_ADMIN_ROLE` can grant addresses the privilege to call the following functions in the contract `Shortfall`: - `updateNextBidderBlockLimit()` - `updateIncentiveBps()` - `updateMinimumPoolBadDebt()` - `updateWaitForFirstBidder()` Any compromise to the `DEFAULT_ADMIN_ROLE` or these privileged functions may allow the hacker to take advantage of this authority and do the following: - Update the time a bidder has to make the next bid before an auction can be closed; - Update the incentive BPS; - Update the minimum pool debt needed to start the auction; - Update the time needed for the first bid before the auction will need to be restarted; ### BaseJumpRateModelV2.sol The role `DEFAULT_ADMIN_ROLE` can grant addresses the privilege to call the following functions in the contract `BaseJumpRateModelV2`: - `updateJumpRateModel()` Any compromise to the `DEFAULT_ADMIN_ROLE` or these privileged functions may allow the hacker to take advantage of this authority and change the `baseRatePerYear`, `multiplierPerYear`, `jumpMultiplierPerYear`, and `kink`. This may allow the hacker to change rates to collect more interest on supply, pay less interest on borrows, or sabotage the protocol. ### PoolRegistry.sol The role `DEFAULT_ADMIN_ROLE` can grant addresses the privilege to call the following functions in the contract `PoolRegistry`: - `addMarket()` - `createRegistryPool()` - `updatePoolMetadata()` - `setPoolName()` Any compromise to the `DEFAULT_ADMIN_ROLE` or these privileged functions may allow the hacker to take advantage of this authority and do the following: - Add a new market with rates and parameters they set. A hacker could use this to add a market for a coin they control and manipulate the price to take suppliers collateral and cause the protocol to incur large amounts of bad debt; - Create a new registry pool with parameters they set including the beacon address. A hacker could take advantage of this by inputting a beacon address that points to a malicious comptroller implementation allowing them to take any funds supplied to the pool; - Update a pools metadata to change the risk rating of the pool, category, logo URL, and description; - Change the name of a pool; ### RewardsDistributor.sol The role `DEFAULT_ADMIN_ROLE` can grant addresses the privilege to call the function `setRewardTokenSpeeds()` in the contract `RewardsDistributor`. Any compromise to the `DEFAULT_ADMIN_ROLE` or these privileged functions may allow the hacker to take advantage of this authority and change the reward token speed to any value. In the contract `RewardsDistributor` the role `onlyOwner` has authority over the following functions: - `setContributorRewardTokenSpeed()` - `setMaxLoopsLimit()` - `grantRewardToken()` Any compromise to the `onlyOwner` account may allow the hacker to take advantage of this authority and do the following: - Change the contributor reward token speed to any value; - Change the max loops, which limits that amount of `vToken` that `claimRewardToken()` can be called on at one time; - Grant any amount of reward tokens, provided enough are held by the contract, to any user. In addition, the `onlyOwner` is responsible for ensuring the contract has enough of the reward token to allow users to claim the rewards they have earned. Either by ensuring enough tokens are supplied to the contract or that the functions above are used in a way that will not exceed the contracts reward token balance. ### ProtocolShareReserve.sol In the contract `ProtocolShareReserve` the role `onlyOwner` has authority over the function `setPoolRegistry()`. Any compromise to the `onlyOwner` account may allow the hacker to take advantage of this authority and change the `poolRegistry` address. ### RiskFund.sol In the contract `RiskFund` the role `onlyOwner` has authority over the following functions: - `setPoolRegistry()` - `setShortfallContractAddress()` - `setPancakeSwapRouter()` - `setMaxLoopsLimit()` Any compromise to the `onlyOwner` account may allow the hacker to take advantage of this authority and do the following: - Set the `poolRegistry` address to a contract they control - Set the `shortfall` contract address to an address they control to steal any reserve that is supposed to be transferred for auction; - Set the PancakeSwap router to a malicious contract to steal any tokens that are intended to be swapped; - Change the max loops, which limits the amount of `markets` that can be input into `swapPoolsAssets()`. In the contract `RiskFund` the role `shortfall` has authority over the function `transferReserveForAuction()`. Any compromise to the `shortfall` account may allow the hacker to take advantage o
The Venus Isolated Pools protocol contains upgradeable contracts, the owner can upgrade the contracts at any time without the community's commitment. If an attacker compromises the account, they can change the implementation of the contract and drain tokens from the contract.
The function `claimRewardToken()` can be called by anyone to claim the input `holder` rewards. However, a user could claim the rewards for a `holder` without their knowledge which could cause confusion if a holder tries to claim their rewards later and is expecting to receive a different value.
The `VToken.sol` contract includes documentation on use with fee on transfer tokens as the `underlying`, and is intended to be compatible with such tokens. On the occasion where the `underlying` asset takes a fee on transfer, the update to `repayAmountFinal` in internal function `_repayBorrowFresh()` will prevent a user from paying down their full borrow balance in one transaction. In contract `VToken.sol`, the `healBorrow()` function will call `_doTransferIn()` so the `payer` can repay a part of the borrows made by the borrower. \ No check is made to ensure that `repayAmount == actualRepayAmount`, if a non standard token implementation is used as the underlying token, this might cause a borrow to be forgiven without it being repaid as much as it should. --- In `RiskFund.sol`, the function `_swapAsset()` uses `swapExactTokensForTokens()`, which will revert if a token takes a fee on transfer. This will make it impossible for any `underlyingAsset` that takes a fee on transfer to be swapped to the `convertibleBaseAsset`. In addition, if the `convertibleBaseAsset` may be a fee on transfer token, then the `totalAmount` should be determined from the balance of the contract after the swap. This is because `amounts[1]` is the amount to be transferred before a fee is taken and will not be the actual amount received by the contract. ---- In `Shortfall`, if the tokens associated with a `Comptroller` have fees on transfer, `closeAuction()` and `placeBid()` could create a discrepancy between the badDebt and the amount of underlying token for the associated `VToken`. Indeed, there is no check to make sure that the input parameter of `badDebtRecovered()` matches the amount of token that has been effectively transferred.
The variable `minAmountToConvert` is supposed to ensure an `underlyingAsset` is only swapped to the `convertibleBaseAsset` if the amount in USD exceeds it. In `_swapAsset()` an oracle is used to determine the expected value in USD of the `underlyingAsset`. However, the swap is always done using Pancakeswap, whose price can be manipulated. If the `amountOutMin` is set less than the `minAmountToConvert` a malicious user could manipulate the price on Pancakeswap and the assets swapped for less than the `minAmountToConvert`.
The function `updatePrices()` calls `oracle_.updatePrice` for all of a users `accountAssets`. If a user has a large amount of assets added, then this may exceed the gas limit and cause a revert and prevent them from being liquidated. Note that the total number of markets supported by a comptroller is bounded above by the `maxLoopsLimit`, so we give this an informational severity.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (55)
1,045 projects reviewed · 1,376 reports · latest May 2025
See CertiK’s auditsSomething wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.
Tell us