Venus - Diamond Comptroller (Subscription Audit 5)

CertiKFiles named in the report

Audit

Part of CertiK’s series

CertiK reviewed Venus Protocol (Venus - Diamond Comptroller (Subscription Audit 5)) on 3 Aug 2023: 10 findings, 0 critical; 7 marked fixed, 3 open.

No open critical findings
Open the reportOpen Venus Protocol’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings10

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High200
Medium000
Low107
HighCentralization Related RisksOpen

In the contract `MarketFacet` the role set for `"_supportMarkt(address)"` has authority over the functions listed below - `_supportMarket()` Any compromise to this account may allow a hacker to take advantage of this authority and add a malicious token address they control as a market allowing them to steal other assets. --- In the contract `RewardFacet` the role `admin` or `comptrollerImplementation` has authority over the functions listed below - `_grantXVS()` Any compromise to either account may allow a hacker to take advantage of this authority and send any address the full balance of `XVS` held by the Comptroller. --- In the contract `SetterFacet` the role `admin` has authority over the functions listed below - `_setPriceOracle()` - `_setCloseFactor()` - `_setAccessControl()` - `_setLiquidatorContract()` - `_setPauseGuardian()` - `_setVAIController()` - `_setVAIMintRate()` - `_setTreasuryData()` - `_setComptrollerLens()` - `_setVenusVAIVaultRate()` - `_setVAIVaultInfo()` Any compromise to the `admin` account may allow a hacker to take advantage of this authority and - change the `oracle` to a malicious one. - update the `closeFactorMantissa` to any value, even outside the maximum and minimum specified range. - change the `accessControl` contract so that other privileged functions can be exploited. - change the `liquidatorContract` to one they control. - change the pause guardian in order to block functionality the guardian controls. - update the `vaiController` which is an address that can update the `mintedVAIs` mapping for any address with any amount. - adjust the `vaiMintRate` used in determining the amount of mintable VAI in the `VAIController` contract. - change the `treasuryAddress` to one they control, and adjust the `treasuryPercent` to the maximum value. - change the `comptrollerLens` - update information about the VAI Vault such as its rate of issuance, the `vaiVaultAddress`, the start of its release, and the minimum amount needed for release to the vault. The following functions have their own assigned privileged account based on their function signature: - `_setCollateralFactor()` - `_setLiquidationIncentive()` - `_setMarketBorrowCaps()` - `_setMarketSupplyCaps()` - `_setActionsPaused()` Any compromise to the one of the accounts with the associated privilege may allow a hacker to take advantage of this authority and - change the collateral factor or liquidation incentive to values that allow for manipulation of the protocol. - pause actions to prevent users' ability to, for example, exit markets, or to prevent a position from being liquidated. - adjust the market borrowCaps and supplyCaps so that, for example, a larger borrow is possible. The role `treasuryGuardian` has authority over `_setTreasuryData()`. Any compromise to the `treasuryGuardian` may allow a hacker to take advantage of this authority and change the `treasuryAddress` to one they control, and adjust the `treasuryPercent` to the maximum value. --- In the contract `Diamond.sol` the role `admin` has authority over the functions listed below - `diamondCut()` Any compromise to the `admin` account may allow a hacker to take advantage of this authority and - remove function signature assignments from the storage of the contract, preventing use of the functions from the `Unitroller` - incorrectly set up the association between a function signature and a facet address - use a malicious facet address for implementation of a function in the `Unitroller`

HighCentralized Control of Contract UpgradeOpen

`Diamond.sol` is an upgradeable contract, the `admin` can upgrade the contract without the community's commitment. If an attacker compromises the account, he can change the implementation of the contract and drain tokens from the contract.

LowMissing Check May Cause Functions with `releaseToOpen

Functions `_setVenusVAIVaultRate()` and `_setVAIVaultInfo()` were updated to include the following logic: ```solidity if (vaiVaultAddress != address(0)) { releaseToVault(); } ``` This check is also performed in functions `distributeSupplierVenus()` and `distributeBorrowerVenus()`. In function `_setVAIVaultInfo()`, the `vaiVaultAddress` can be updated to any address. Function `releaseToVault()` however uses address `vaiVaultAddress` in interface `IVAIVault` to call function `updatePendingRewards()`. If the address `vaiVaultAddress` is set to an externally owned account, or a contract which does not include this function, then the call will revert, which keeps any calls to the functions that make the call to `releaseToVault()` revert. Since `_setVAIVaultInfo()` is the function used to update the address, this would prevent the function from being called to correct the issue. The severity is set to minor since the contract logic can be updated to change the logic in the scenario where this occurs.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (18)

  • contracts/Comptroller/Diamond/interfaces/IMarketFacet.sol
  • contracts/Comptroller/Diamond/facets/MarketFacet.sol
  • contracts/Comptroller/Diamond/facets/XVSRewardsHelper.sol
  • contracts/Comptroller/Diamond/interfaces/IRewardFacet.sol
  • contracts/Comptroller/Diamond/Diamond.sol
  • contracts/Comptroller/ComptrollerInterface.sol
  • contracts/Comptroller/Diamond/interfaces/IDiamondCut.sol
  • contracts/Lens/SnapshotLens.sol
  • contracts/Comptroller/Diamond/facets/PolicyFacet.sol
  • contracts/Lens/ComptrollerLens.sol
  • contracts/Tokens/VAI/VAIController.sol
  • contracts/Comptroller/Diamond/facets/RewardFacet.sol
  • contracts/Tokens/VAI/VAIControllerStorage.sol
  • contracts/Comptroller/Diamond/facets/FacetBase.sol
  • contracts/Comptroller/Diamond/facets/SetterFacet.sol
  • contracts/Comptroller/Diamond/interfaces/ISetterFacet.sol
  • contracts/Comptroller/ComptrollerStorage.sol
  • contracts/Comptroller/Diamond/interfaces/IPolicyFacet.sol

Part of Venus Protocol’s security record

Venus Protocol
Audits67 audits by 7 firmsLast audit Sep 2025, by Quantstamp.
Critical findingsNo open critical findingsAcross the 67 reports, 4 critical findings were reported. Each is marked fixed by the firm that reported it.
IncidentIncident 12 May 2022Source: De.Fi incident database.
Open Venus Protocol’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 reports · latest May 2025

See CertiK’s audits

Something 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