Part of Quantstamp’s series
Quantstamp reviewed Venus Protocol (Venus Multichain Support) on 19 Dec 2023: 20 findings, 0 critical; 12 marked fixed, 8 acknowledged; 2 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 | 0 | 0 |
| Medium | 0 | 1 | 3 | 0 |
| Low | 0 | 7 | 9 | 2 |
The `ChainlinkOracle._getChainlinkPrice()` function fetches the latest price of an asset from Chainlink price feeds. However, as the protocol is intended to be deployed on Arbitrum and opBNB, checking the sequencer's uptime before querying price data is crucial. If the sequencer is down, there is a chance of using an incorrect or stale price. Please refer to [Chainlink L2 Sequencer Uptime Feeds](https://docs.chain.link/data-feeds/l2-sequencer-feeds) document for more details.
The function `BaseOFTV2.sendAndCall()` burns or locks XVS tokens from users with the intention of bridging them over to another chain to an address provided by the user. However, the recipient, `_toAddress`, **must** be a contract on the destination chain. Otherwise, the function `OFTCoreV2._sendAndCallAck()` will mint or release tokens through `_creditTo()` without transferring them to the designated address, essentially locking the XVS tokens in the bridge contract. Additionally, if for some reason a failed transaction is unable to be retried through `retryMessage()`, tokens might be unable to be sent to the destination address even though they might have been burned in the source chain.
The XVS bridges are set up as non-blocking LayerZero apps, which allows for the replaying of unsuccessful messages via `NonblockingLzApp.retryMessage()`. `retryMessage()` makes a subsequent call to `OFTCoreV2._nonblockingLzReceive()`, which attempts to retry the failed message. This can be an issue if a trusted remote is compromised and is removed as a trusted remote since neither `retryMessage()` nor `_nonblockingLzReceive()` perform any validation checks on whether the `_srcAddress` on the source chain is still a trusted remote.
The owner of the contracts can call `transferOwnership()` to transfer the ownership to a new address. If an uncontrollable address is accidentally provided as the new owner address then the contract will no longer have an active owner, and functions with the `onlyOwner` modifier can no longer be executed.
The protocol depends on LayerZero for bridging XVS tokens to other chains. As such, the token on each network can be impacted by the possible vulnerabilities in the bridging mechanism. This is an inherent risk of integrating with network bridges, not a specific vulnerability of the token implementation.
The owner of the bridge can set and update trusted remote addresses to verify that interactions with LayerZero are generated from trusted contracts on remote chains. Trusted remote addresses are stored in the mapping `trustedRemoteLookup` where the key is the remote chain ID and the data stored is bytes in the format of `abi.encode(<REMOTE_ADDRESS>, <LOCAL_ADDRESS>)`. Setting trusted remote addresses is performed by calling `setTrustedRemoteAddress()` where the remote address is passed as an argument and then encoded in the aforementioned format. Similarly, `setTrustedRemote()` allows for setting a trusted remote with data encoded off-chain. Since `setTrustedRemote()` does not validate the input data, it is entirely possible to encode the incorrect data or encode it in the incorrect format. If the `trustedRemoteLookup` mapping does not contain data in the correct format, bridging tokens to another chain will fail.
* `VTreasuryV8.withdrawTreasuryToken()`: - Validate that `tokenAddress` and `withdrawAddress` are not `address(0)` to avoid losing funds. - Validate that `withdrawAmount` is not 0. * `VTreasuryV8.withdrawTreasuryNative()`: - Validate that `withdrawAddress` is not `address(0)` to avoid loss of funds. - Validate that `withdrawAmount` is not 0. * `BaseXVSProxyOFT.setMaxSingleTransactionLimit()`: * Validate that the `limit_` is less than or equal to the `chainIdToMaxDailyLimit`. * `BaseXVSProxyOFT.setMaxSingleReceiveTransactionLimit()`: * Validate that the `limit_` is less than or equal to the `chainIdToMaxDailyReceiveLimit`. * `ResilientOracle.constructor()`: * Validate that `nativeMarketAddress` is not the zero address.
This issue highlights the potential failures users may encounter when bridging the XVS tokens. The following scenario may prevent users from sending XVS tokens from the source chain: 1. The oracle temporarily fails due to reasons including being paused by the owner, incorrect address configuration, or price validation failures. 2. The transfer amount exceeds the single or daily sending transaction limit. 3. The transfer amount is too small, becoming zero after removing dust. 4. The sender is blacklisted by the XVS token. 5. The destination bridge is not configured as a trusted remote. The following scenario may prevent users from receiving XVS tokens on the destination chain. Users may retry the failed messages after some period: 1. The oracle temporarily fails due to reasons including being paused by the owner, incorrect address configuration, or price validation failures. 2. The transfer amount exceeds the single or daily receiving transaction limit. 3. The recipient is blacklisted by the XVS token. 4. The minting cap on the destination bridge is exceeded. Specifically, if the source bridge is not configured as a trusted remote on the destination chain, the cross-chain messages from the source bridge will be blocked. A privileged role has to add or update the trusted remotes on the destination chain and call `retryPayload()` on LayerZero's Endpoint to retry the blocked message. Note that the `LzApp.forceResumeReceive()` function will drop the blocked message without retrying forwarding it to the destination bridge, which should only be used in extreme circumstances as it can potentially cause loss of funds.
According to the Hardhat config file, the `VTreasuryV8` contract is compiled in Solidity version 0.8.20 with the EVM version set as the default Shanghai version. As a result, the contract bytecode may include `PUSH0` opcodes, which are not supported on certain EVM chains, including BSC, [Arbitrum](https://docs.arbitrum.io/solidity-support), [Optimism](https://community.optimism.io/docs/developers/build/differences/), and opBNB. The deployment or execution of the contract may fail due to the use of an invalid opcode.
The `XVSBridgeAdmin` contract has a `payable` fallback function without a withdraw function. Also, there is no native token provided in the call to the XVS bridge contract. As a result, any native tokens sent in a fallback function call will be locked in the admin contract.
Solidity's `transfer()` function forwards a fixed amount of 2300 gas to the recipient when transferring native tokens to them, which causes several limitations if the recipient is a contract. First, the limited amount of gas prevents the contract from executing more complicated logic (e.g., external calls) in its `fallback()` or `receive()` function. Second, the gas costs of each opcode are subject to change, and therefore, it is not guaranteed that currently successful transfers will not fail in the future. The `VTreasury.withdrawTreasuryNative()` allows the owner to withdraw native tokens from the Venus Treasury, which uses Solidity's `transfer()` function to transfer native tokens to a designated address.
The `owner` of the XVS bridge can pause or unpause the bridge. When the bridge is paused, function calls to `_debitFrom()` and `_creditTo()` will revert. The `_debitFrom()` function is called when a user initiates a transfer on the source chain, and the `_creditTo()` function is called when the user receives the transferred token on the destination chain. No user can initiate a transfer from the source bridge to others when a source bridge is paused. However, when a destination bridge is paused, the following scenarios are still possible: 1. The destination bridge can receive cross-chain messages, which attempt to mint or release tokens to the receiver. Although these messages will fail, they can be retried once the destination bridge is unpaused. 2. Messages of type `PT_SEND_AND_CALL` will trigger an `onOFTReceived()` function call to the recipient. If the call fails, the messages will be stored, but the XVS tokens will be credited to the bridge. These messages can be retried during the pause period since they do not execute the `_creditTo()` but the `_transferFrom()` function. As a result, the recipient will still be able to receive the tokens during the pausing period.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (22)
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