Venus Multichain Support

QuantstampRepository at commit 5299454

Audit

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.

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

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings30

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

SeverityOpenAcknowledgedFixedMitigated
Critical0000
High0000
Medium0130
Low0792
MediumMissing Checks for Sequencer Uptime When Fetching Chainlink PricesFixed

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.

MediumPotential of Locked Funds in XVS BridgesFixed

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.

MediumXVS Bridges May Accept Messages from Compromised RemotesFixed

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.

LowCritical Role Transfer Not Following Two-Step PatternFixed

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.

LowExtensive Reliance on External ApplicationsFixed

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.

LowInconsistent Data Format For Trusted Remotes in The XVS BridgeFixed

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.

LowMissing Input ValidationFixed

* `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.

LowPossible Failures of Bridging XVS TokensFixed

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.

LowPotential EVM Compatibility Issue in Solidity Verison >=0.8.20Fixed

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.

LowPotential of Locked Funds in the XVS Bridge Admin ContractFixed

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.

Show 2 more
LowUse of Solidity's `transfer()` FunctionFixed

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.

LowXVS Bridges May Still Receive or Release Tokens When PausedFixed

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.

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 (22)

  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/token/XVS.sol at commit 5299454
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSVaultProxy.sol at commit a158f8c
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/interfaces/IXVS.sol at commit 5299454
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/interfaces/IXVSProxyOFT.sol at commit 5299454
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSVaultErrorReporter.sol at commit a158f8c
  • https://github.com/VenusProtocol/isolated-pools/contracts/JumpRateModelV2.sol at commit 5e660bf
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/token/TokenController.sol at commit 5299454
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSVault.sol at commit a158f8c
  • https://github.com/VenusProtocol/governance-contracts/contracts/Governance/AccessControlManager.sol at commit 358bed4
  • https://github.com/VenusProtocol/isolated-pools/contracts/WhitePaperInterestRateModel.sol at commit 5e660bf
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/XVSBridgeAdmin.sol at commit 5299454
  • https://github.com/VenusProtocol/venus-protocol/contracts/Governance/VTreasuryV8.sol at commit 0a05857
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol at commit a158f8c
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/BaseXVSProxyOFT.sol at commit 5299454
  • https://github.com/VenusProtocol/oracle/contracts/oracles/ChainlinkOracle.sol at commit a0a36bc
  • https://github.com/VenusProtocol/venus-protocol/contracts/XVSVault/XVSStore.sol at commit a158f8c
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/XVSProxyOFTSrc.sol at commit 5299454
  • https://github.com/VenusProtocol/isolated-pools/contracts/BaseJumpRateModelV2.sol at commit 5e660bf
  • https://github.com/VenusProtocol/oracle/contracts/ResilientOracle.sol at commit a0a36bc
  • https://github.com/VenusProtocol/isolated-pools/contracts/lib/constants.sol at commit 5e660bf
  • https://github.com/VenusProtocol/protocol-reserve/contracts/ProtocolReserve/ProtocolShareReserve.sol at commit e396119
  • https://github.com/VenusProtocol/isolated-pools/contracts/Bridge/XVSProxyOFTDest.sol at commit 5299454

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

Quantstamp

240 projects reviewed · 338 reports · latest Nov 2026

See Quantstamp’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