CVE-2023-35163: Code.vegaprotocol.io/vega Vega's Validators Able To Submit Vulnerability

MODERATE
Advisory Identifier: GHSA-8rc9-vxjh-qjf2
CVSS 6.0
CWE-20
Published
Advisory Summary

CVE-2023-35163 is a MODERATE (CVSS 6.0) vega's validators able to submit vulnerability (CWE-20: Improper Input Validation) affecting Code.vegaprotocol.io/vega libraries in the Go ecosystem. The issue involves vega's validators able to submit duplicate transactions. Remediation is available by upgrading affected packages to version 0.71.6.

CVE-2023-35163 at a Glance

CVE Identifier CVE-2023-35163
GHSA Identifier GHSA-8rc9-vxjh-qjf2
Severity MODERATE
CVSS v3.1 Base Score 6.0
CWE Classification CWE-20: Improper Input Validation
Affected Product Code.vegaprotocol.io/vega
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:C/C:H/I:L/A:L).

Attack Vector Physical (AV:P)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2023-35163

To remediate this vulnerability, upgrade all affected Code.vegaprotocol.io/vega dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

code.vegaprotocol.io/vega fixed: 0.71.6
Upgrade code.vegaprotocol.io/vega to 0.71.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for code.vegaprotocol.io/vega

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-35163, inspect your project dependencies for Code.vegaprotocol.io/vega:

inspect dependencies for code.vegaprotocol.io/vega

Analyze the terminal output to locate any version of Code.vegaprotocol.io/vega in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.71.6), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Code.vegaprotocol.io/vega, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A vulnerability exists that allows a malicious validator to trick the Vega network into re-processing past Ethereum events from Vega’s Ethereum bridge. For example, a deposit to the collateral bridge for 100USDT that credits a party’s general account on Vega, can be re-processed 50 times resulting in 5000USDT in that party’s general account. This is without depositing any more than the original 100USDT on the bridge. Despite this exploit requiring access to a validator's Vega key, a validator key can be obtained at the small cost of 3000VEGA, the amount needed to announce a new node onto the network. The steps to carry out this exploit are as follows: 1. Cause an Ethereum event on one of the bridge contracts e.g a deposit to the collateral bridge, or the staking bridge 2. This will result in the Ethereum-event-forwarder of each node to submit a ChainEvent transaction to the Vega network corresponding to that event 3. Scrape the valid chain event transaction from the Tendermint block data using a node’s Tendermint API 4. Change the value of the `txId` field of the ChainEvent to any valid, but different, value 5. Bundle the tweaked ChainEvent into a new transaction, sign it with a validator key and resubmit to the Vega network 6. The fraudulent ChainEvent will be processed by Vega as if it were a new ChainEvent even though it did not occur on Ethereum The key to this exploit is in step 4. The `txId` field of the ChainEvent is used when checking for ChainEvent resubmission, but NOT during the subsequent on-chain verification of the event. Therefore changing the `txId` of an existing ChainEvent is enough to by-pass the duplication check and for it to still be verified as a real event. ### Impact The impact of this exploit is dependent on the ChainEvent being manipulated. The below table describes each one: | Chain Event | Allows | Consequence | | ------------- | ------------- | ------------- | | Deposit | Generation of unlimited funds of any asset | Withdrawal of all assets | | Stake Deposit | Delegate unlimited Vega to a single node | A single node has controlling amount of voting power | | Stake Removed | Force a Validator node to drop below self-stake requirements | Prevents reward payouts | | Bridge Stop | The Vega network to think the bridge is stopped | Prevent anyone from withdrawing funds | | Signer Removed | The Vega network to think a validator nodes is not on the multisig contract | Prevent reward payouts | ### Patches v0.71.6 ### Workarounds No work around known, however there are mitigations in place should this vulnerability be exploited: - there are monitoring alerts, for `mainnet1`, in place to identify any issues of this nature including this vulnerability being exploited - the validators have the ability to stop the bridge thus stopping any withdrawals should this vulnerability be exploited ### References N/A

CVE-2023-35163 Affected Code.vegaprotocol.io/vega Versions

1 component(s)
Fixed Versions:
0.71.6
Product / Package Ecosystem Affected Versions Fixed Version
code.vegaprotocol.io/vega
Go
< 0.71.6
0.71.6

References

Frequently Asked Questions

What is CVE-2023-35163?
CVE-2023-35163 is a security vulnerability in Code.vegaprotocol.io/vega involving Vega's validators able to submit duplicate transactions under CWE-20: Improper Input Validation.
Which Code.vegaprotocol.io/vega versions are affected?
Affected versions include releases prior to 0.71.6 across affected packages: code.vegaprotocol.io/vega.
What version fixes CVE-2023-35163?
Upgrading to 0.71.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is code.vegaprotocol.io/vega affected?
Yes, code.vegaprotocol.io/vega is affected in releases prior to 0.71.6. Upgrade your dependency to 0.71.6 or later.
What is the CVSS score of CVE-2023-35163?
CVE-2023-35163 has a CVSS v3.1 base score of 6.0 (MODERATE) with vector string CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:C/C:H/I:L/A:L.
What CWE is associated with CVE-2023-35163?
CVE-2023-35163 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2023-35163?
Run the dependency tree command: 'inspect dependencies for code.vegaprotocol.io/vega'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8rc9-vxjh-qjf2",
  "modified" : "2023-06-26T16:32:12Z",
  "published" : "2023-06-20T16:36:18Z",
  "aliases" : [ "CVE-2023-35163" ],
  "summary" : "Vega's validators able to submit duplicate transactions ",
  "details" : "A vulnerability exists that allows a malicious validator to trick the Vega network into re-processing past Ethereum events from Vega’s Ethereum bridge. For example, a deposit to the collateral bridge for 100USDT that credits a party’s general account on Vega, can be re-processed 50 times resulting in 5000USDT in that party’s general account. This is without depositing any more than the original 100USDT on the bridge.\n\nDespite this exploit requiring access to a validator's Vega key, a validator key can be obtained at the small cost of 3000VEGA, the amount needed to announce a new node onto the network.\n\nThe steps to carry out this exploit are as follows:\n1. Cause an Ethereum event on one of the bridge contracts e.g a deposit to the collateral bridge, or the staking bridge\n2. This will result in the Ethereum-event-forwarder of each node to submit a ChainEvent transaction to the Vega network corresponding to that event\n3. Scrape the valid chain event transaction from the Tendermint block data using a node’s Tendermint API\n4. Change the value of the `txId` field of the ChainEvent to any valid, but different, value\n5. Bundle the tweaked ChainEvent into a new transaction, sign it with a validator key and resubmit to the Vega network\n6. The fraudulent ChainEvent will be processed by Vega as if it were a new ChainEvent even though it did not occur on Ethereum\n\nThe key to this exploit is in step 4. The `txId` field of the ChainEvent is used when checking for ChainEvent resubmission, but NOT during the subsequent on-chain verification of the event. Therefore changing the `txId` of an existing ChainEvent is enough to by-pass the duplication check and for it to still be verified as a real event.\n\n### Impact\nThe impact of this exploit is dependent on the ChainEvent being manipulated. The below table describes each one:\n\n| Chain Event  | Allows | Consequence |\n| ------------- | ------------- | ------------- |\n| Deposit | Generation of unlimited funds of any asset  | Withdrawal of all assets |\n| Stake Deposit  | Delegate unlimited Vega to a single node  | A single node has controlling amount of voting power  |\n| Stake Removed  | Force a Validator node to drop below self-stake requirements  | Prevents reward payouts  |\n| Bridge Stop  | The Vega network to think the bridge is stopped  | Prevent anyone from withdrawing funds  |\n| Signer Removed  | The Vega network to think a validator nodes is not on the multisig contract  | Prevent reward payouts  |\n\n### Patches\nv0.71.6\n\n### Workarounds\nNo work around known, however there are mitigations in place should this vulnerability be exploited:\n\n- there are monitoring alerts, for `mainnet1`, in place to identify any issues of this nature including this vulnerability being exploited\n- the validators have the ability to stop the bridge thus stopping any withdrawals should this vulnerability be exploited\n\n### References\nN/A\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:C/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "code.vegaprotocol.io/vega"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.71.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vegaprotocol/vega/security/advisories/GHSA-8rc9-vxjh-qjf2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-35163"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vegaprotocol/vega/commit/56b09bf57af8cd9eca5996252d86f469a3e34c68"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vegaprotocol/vega"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vegaprotocol/vega/releases/tag/v0.71.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-20T16:36:18Z",
    "nvd_published_at" : "2023-06-23T21:15:09Z"
  }
}