Part of Quantstamp’s series
Quantstamp reviewed Venus Protocol (Venus protocol (vaults)) on 19 May 2023: 16 findings, 0 critical; 10 marked fixed, 4 acknowledged, 2 open; 4 more marked mitigated.
Report hosted on certificate.quantstamp.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed | Mitigated |
|---|---|---|---|---|
| Critical | 0 | 0 | 0 | 0 |
| High | 0 | 0 | 3 | 0 |
| Medium | 0 | 0 | 4 | 0 |
| Low | 2 | 4 | 3 | 4 |
Privileged users can call `withdrawBep20()` to transfer any amount of any token held by the contract to an address of their choice. While this is useful for transferring any unsupported tokens sent to the contract, this allows any privileged user to drain the contract of its entire VRT balance.
Smart contracts will often have `owner` variables to designate the person with special privileges to make modifications to the smart contract. Certain contracts have state variables, e.g. `owner`, which provide certain addresses with privileged roles. Such roles may pose a risk to end-users. Contracts `VAIVault.sol`, `VRTVault.sol` and `XVSVault.sol` had their access controls setup via the two custom contracts (which themselves were however out-of-scope for this audt) [`AccessControlledV5.sol`](https://github.com/VenusProtocol/governance-contracts/blob/main/contracts/Governance/AccessControlledV5.sol) and [`AccessControlManager.sol`](https://github.com/VenusProtocol/governance-contracts/blob/main/contracts/Governance/AccessControlManager.sol): - Access is checked via function `AccessControlledV5._checkAccessAccessControlledV5Allowed()`, having a string of the function signature of the to-be-checked function as the parameter. - Access is granted via `AccessControlManager.giveCallPermission()`, where addresses are granted access to specific function signature strings (and if non-zero, tied to specific contract addresses). - Access is revoked via `AccessControlManager.revokeCallPermission()`, where addresses are revoked access to specific function signature strings (and if non-zero, tied to specific contract addresses). The `XVSVault.sol` contract contains the following privileged roles: 1. An administrator (`admin`, `onlyAdmin()` modifier), as initialized during the constructor execution to `msg.sender`: 1. Renounce the role (**and thereby preventing any future calls to the followingly listed funcitons!**) by calling `burnAdmin()`. 1. Change the XVS store contract address (`xvsStore`) that controls reward token transfers by calling `setXvsStore()`. 1. Change the access control manager implementation address (and thereby indirectly all `_checkAccessAllowed()`-controlled access checks) by calling `setAccessControl()`. The following functions in this contract are protected through `_checkAccessAllowed()` with their corresponding function signatures: 1. `"pause()"`: Pause the contract (and thereby all calls to `deposit()`, `claim()`, `executeWithdrawal()`, `requestWithdrawal()`, `updatePool()`, `delegate()` and `delegateBySig()`) by calling `pause()`. 1. `"resume()"`: Resume the contract from a paused state by calling `resume()`. 1. `"add(address,uint256,address,uint256,uint256)"`: Add a new pool by calling `add()`. 1. Using an existing reward token, but a new pool token allows the caller to globally update the `rewardTokenAmountsPerBlock[]` variable for all pools using this reward token, **without explicitly calling `setRewardAmountPerBlock()`**. In the extreme cases this could either drain the reward token (by choosing a high reward value) or halt any future rewards (by choosing zero). 1. **Accidentally or with malicious intent the caller could add enough new pools to make calling `massUpdatePools()` prohibitively gas-expensive and thereby denial the service to the following functions**: 1. `add()`. 1. `set()`. 1. `setRewardAmountPerBlock()`. 1. `"set(address,uint256,uint256)"`: Update the accumulated rewards per share for all pools and change the allocation point of a pool by calling `set()`. 1. `"setRewardAmountPerBlock(address,uint256)"`: Update the accumulated rewards per share for all pools and arbitrarily change the reward amount per block by calling `setRewardAmountPerBlock()`. 1. **By setting it to zero no additional rewards would be accumulated.** 1. **By setting it to an unusually high value the reward token could be drained.** 1. `"setWithdrawalLockingPeriod(address,uint256,uint256)"`: Change the lockup period for withdrawing deposited funds by calling `setWithdrawalLockingPeriod()`. 1. **Funds could be held indefinitely by choosing high lockup times and/or always extending an existing period.** The `XVSStore.sol` contract contains the following privileged roles: 1. An administrator (`admin`, `onlyAdmin()` modifier), as initialized during the constructor execution to `msg.sender`: 1. Transfer the role to another address (which has to accept it by calling `acceptAdmin()`) by calling `setPendingAdmin()`. 1. Designate a new owner role by calling `setNewOwner()`. 1. Add/remove token addresses from the `rewardTokens[]` array by calling `setRewardToken()`. 1. An owner (`owner`, `onlyOwner()` modifier), as set through `setNewOwner()` by `admin`: 1. Transfer an arbitrary amount of reward tokens by calling `safeRewardTransfer()`. 1. **A compromised owner could drain all funds from this contract by**: 1. Adding a to-be-drained token to the `rewardTokens[]` array, if not already a reward token. 1. Transfer an arbitrary amount by calling `safeRewardTransfer()`. 1. **A comrpomised admin could drain all funds from this contract by**: 1. Adding a to-be-drained token to the `rewardTokens[]` array, if not already a rewar
The contracts are compiled under Solidity `v0.5.16`, which is considered outdated and may contain known compiler bugs that can affect the logic of the contracts. The use of experimental features, e.g., `pragma experimental ABIEncoderV2;` should also be avoided since they were not tested thoroughly at the time of the outdated Solidity versions and [several known bugs](https://blog.ethereum.org/2019/03/26/solidity-optimizer-and-abiencoderv2-bug/) existed in the past.
Although the privileged roles can pause the deposit and withdrawals on the VRT vault, users still earn the interests during the pausing period since the interests are calculated block-by-block until the last accruing block. Users can claim their interest during this period when the vault is unpaused.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (7)
240 projects reviewed · 338 reports · latest Nov 2026
See Quantstamp’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