Vulnerabilities in pkg:golang/github.com/multiversx/mx-chain-go

PACKAGE
Advisory Identifier: GHSA-j494-7x2v-vvvp
Advisory Summary

CVE-2023-34458 is a HIGH (CVSS 7.1) mx-chain-go's relayed transactions always increment vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Github.com/multiversx/mx chain go libraries in the Go ecosystem. The issue involves mx-chain-go's relayed transactions always increment nonce. Remediation is available by upgrading affected packages to version 1.4.17.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/multiversx/mx-chain-go

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/multiversx/mx-chain-go. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-j494-7x2v-vvvp CVE-2023-34458 HIGH mx-chain-go's relayed transactions always increment nonce
GHSA-7xpv-4pm9-xch2 CVE-2023-33964 HIGH mx-chain-go does not treat invalid transaction with wrong username correctly

CVE-2023-34458 at a Glance

CVE Identifier CVE-2023-34458
GHSA Identifier GHSA-j494-7x2v-vvvp
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Github.com/multiversx/mx chain go
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.1

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

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2023-34458

To remediate this vulnerability, upgrade all affected Github.com/multiversx/mx chain go dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/multiversx/mx-chain-go fixed: 1.4.17
Upgrade github.com/multiversx/mx-chain-go to 1.4.17
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 github.com/multiversx/mx-chain-go

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-34458, inspect your project dependencies for Github.com/multiversx/mx chain go:

inspect dependencies for github.com/multiversx/mx-chain-go

Analyze the terminal output to locate any version of Github.com/multiversx/mx chain go in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.17), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Github.com/multiversx/mx chain go, 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

### Impact When executing a relayed transaction, if the inner transaction failed, it would have increased the inner transaction's sender account nonce. This could have contributed to a limited DoS attack on a targeted account. The fix is a breaking change so a new flag `RelayedNonceFixEnableEpoch` was needed. This was a strict processing issue while validating blocks on a chain. ### Patches v1.4.17 and later versions contain the fix for this issue ### Workarounds there were no workarounds for this issue. The affected account could only wait for the DoS attack to finish as the attack was not free or to attempt to send transactions in a very fast manner so as to compete on the same nonce with the attacker. ### References For the future understanding of this issue, on v1.4.17 and onwards versions, we have this integration test that addresses the issue and tests the fix. https://github.com/multiversx/mx-chain-go/blob/babdb144f1316ab6176bf3dbd7d4621120414d43/integrationTests/vm/txsFee/relayedMoveBalance_test.go#LL165C14-L165C14

CVE-2023-34458 Affected Github.com/multiversx/mx chain go Versions

1 component(s)
Fixed Versions:
1.4.17
Product / Package Ecosystem Affected Versions Fixed Version
github.com/multiversx/mx-chain-go
Go
< 1.4.17
1.4.17

References

Frequently Asked Questions

What is CVE-2023-34458?
CVE-2023-34458 is a security vulnerability in Github.com/multiversx/mx chain go involving mx-chain-go's relayed transactions always increment nonce under CWE-400: Uncontrolled Resource Consumption.
Which Github.com/multiversx/mx chain go versions are affected?
Affected versions include releases prior to 1.4.17 across affected packages: github.com/multiversx/mx-chain-go.
What version fixes CVE-2023-34458?
Upgrading to 1.4.17 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/multiversx/mx-chain-go affected?
Yes, github.com/multiversx/mx-chain-go is affected in releases prior to 1.4.17. Upgrade your dependency to 1.4.17 or later.
What is the CVSS score of CVE-2023-34458?
CVE-2023-34458 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:H.
What CWE is associated with CVE-2023-34458?
CVE-2023-34458 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for CVE-2023-34458?
Run the dependency tree command: 'inspect dependencies for github.com/multiversx/mx-chain-go'. 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-j494-7x2v-vvvp",
  "modified" : "2023-07-14T13:28:34Z",
  "published" : "2023-07-13T17:02:12Z",
  "aliases" : [ "CVE-2023-34458" ],
  "summary" : "mx-chain-go's relayed transactions always increment nonce",
  "details" : "### Impact\nWhen executing a relayed transaction, if the inner transaction failed, it would have increased the inner transaction's sender account nonce. This could have contributed to a limited DoS attack on a targeted account. The fix is a breaking change so a new flag `RelayedNonceFixEnableEpoch` was needed. This was a strict processing issue while validating blocks on a chain.\n\n### Patches\nv1.4.17 and later versions contain the fix for this issue\n\n### Workarounds\nthere were no workarounds for this issue. The affected account could only wait for the DoS attack to finish as the attack was not free or to attempt to send transactions in a very fast manner so as to compete on the same nonce with the attacker.\n\n### References\nFor the future understanding of this issue, on v1.4.17 and onwards versions, we have this integration test that addresses the issue and tests the fix. \nhttps://github.com/multiversx/mx-chain-go/blob/babdb144f1316ab6176bf3dbd7d4621120414d43/integrationTests/vm/txsFee/relayedMoveBalance_test.go#LL165C14-L165C14\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/multiversx/mx-chain-go"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.17"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/multiversx/mx-chain-go/security/advisories/GHSA-j494-7x2v-vvvp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34458"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/multiversx/mx-chain-go/commit/babdb144f1316ab6176bf3dbd7d4621120414d43"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/multiversx/mx-chain-go"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/multiversx/mx-chain-go/blob/babdb144f1316ab6176bf3dbd7d4621120414d43/integrationTests/vm/txsFee/relayedMoveBalance_test.go#LL165C14-L165C14"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/multiversx/mx-chain-go/releases/tag/v1.4.17"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-13T17:02:12Z",
    "nvd_published_at" : "2023-07-13T19:15:09Z"
  }
}