Part of CertiK’s series
CertiK reviewed Venus Protocol (Venus - Vaults Audit) on 4 Jul 2023: 10 findings, 0 critical; 3 marked fixed, 7 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 | 0 |
| High | 1 | 0 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 6 | 0 | 3 |
In the contract `VRTVault` the role `admin` has authority over the functions shown in the diagram below. Any compromise to the `admin` account may allow the hacker to take advantage of this authority and modify the access control.  ---- Other privileged accounts have authority over the functions: - `pause()`; - `resume()`; - `withdrawBep20()`; - `setLastAccruingBlock()`; Any compromise to one of these accounts may allow the hacker to take advantage of this authority and: - pause the contract, preventing users from withdrawing their tokens; - transfer any token from the contract to an address they control; - set an extreme value to `lastAccruingBlock` so interests keep being accrued. ----- ----- In the contract `VAIVault` the role `admin` has authority over the functions shown in the diagram below. Any compromise to the `admin` account may allow the hacker to take advantage of this authority and modify the access control.  ---- Other privileged accounts have authority over the functions: - `pause()`; - `resume()`. Any compromise to one of the privileged addresses may allow the hacker to take advantage of this authority and pause or unpause the contract. ----- ----- In the contract `XVSStore` the role `admin` has authority over the functions shown in the diagram below. Any compromise to the `admin` account may allow the hacker to take advantage of this authority and : - set an address they control as the new `pendingAdmin`; - set an address they control as the new `owner`; - set any malicious token contract as a reward token.  ---- In the contract `XVSStore` the role `owner` has authority over the functions shown in the diagram below. Any compromise to the `owner` account may allow the hacker to take advantage of this authority and: - transfer reward tokens from the contract to an address they control; - transfer any token to its own address. - set any malicious token contract as a reward token.  ---- In the contract `XVSStore` the role `pendingAdmin` has authority over the functions shown in the diagram below. Any compromise to the `pendingAdmin` account may allow the hacker to take advantage of this authority and become the new admin.  ----- ----- In the contract `XVSVault` the role `admin` has authority over the functions shown in the diagram below. Any compromise to the `admin` account may allow the hacker to take advantage of this authority and modify the access control.  ---- Other privileged accounts have authority over the functions: - `pause()` - `resume()` - `add()` - `set()` - `setRewardAmountPerBlock()` - `setWithdrawalLockingPeriod()` Any compromise to one of the privileged addresses may allow the hacker to take advantage of this authority and - pause or unpause the contract; - add a new pool with malicious tokens and set its reward allocation very high to steal reward tokens; - set a significantly high reward amount per block for certain tokens, allowing the hacker to earn more reward tokens than expected. - set the `lockPeriod` of a specific pool extremely high so users cannot request withdrawal anymore.
A reentrancy attack can occur when the contract creates a function that makes an external call to another untrusted contract before resolving any effects. If the attacker can control the untrusted contract, they can make a recursive call back to the original function, repeating interactions that would have otherwise not run after the external call resolved the effects. *This finding is considered minor because the reentrancy only causes out-of-order events.* ### External call(s) ```solidity=193 IXVSStore(xvsStore).setRewardToken(_rewardToken, true); ``` ### Events emitted after the call(s) ```solidity=195 emit PoolAdded(_rewardToken, poolInfo.length - 1, address(_token), _allocPoint, _rewardPerBlock, _lockPeriod); ```
Boolean constants can be used directly and do not need to be compared to true or false. ```solidity=76 require(vaultPaused == false, "Vault is paused"); ``` --- ```solidity=56 require(vaultPaused == false, "Vault is paused"); ``` --- ```solidity=46 require(rewardTokens[token] == true, "only reward token can"); ``` --- ```solidity=108 require(vaultPaused == false, "Vault is paused"); ```
There should always be events emitted in the sensitive functions that are controlled by centralization roles.
In `VRTVault`, the function `setLastAccruingBlock()` allows setting `lastAccruingBlock` to an arbitrary value. ---- In `XVSVault`: - the function `setRewardAmountPerBlock()` allows setting `rewardTokenAmountsPerBlock[_rewardToken]` to an arbitrary value. - the function `setWithdrawalLockingPeriod()` allows setting `pool.lockPeriod` to an arbitrary value.
Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. For example, transferring tokens to a zero address can result in a permanent loss of those tokens. --- ```solidity=60 pendingAdmin = _admin; ``` - `_admin` is not zero-checked before being used.
In the contract `XVSStore`, the library `SafeMath` is declared on a using-for directive but its functionalities are never used, which can lead to unnecessary complexity and reduced maintainability.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (7)
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