CVE-2022-36061: Github.com/ElrondNetwork/elrond go Elrond-go Has Improper Initialization Vulnerability

CRITICAL
Advisory Identifier: GHSA-mv8x-668m-53fg
CVSS 9.8
CWE-665
Published
Advisory Summary

CVE-2022-36061 is a CRITICAL (CVSS 9.8) elrond-go has improper initialization vulnerability (CWE-665: Improper Initialization) affecting Github.com/ElrondNetwork/elrond go libraries in the Go ecosystem. The issue involves elrond-go has improper initialization. Remediation is available by upgrading affected packages to version 1.3.35.

CVE-2022-36061 at a Glance

CVE Identifier CVE-2022-36061
GHSA Identifier GHSA-mv8x-668m-53fg
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-665: Improper Initialization
Affected Product Github.com/ElrondNetwork/elrond go
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.8

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

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

How to Fix CVE-2022-36061

To remediate this vulnerability, upgrade all affected Github.com/ElrondNetwork/elrond 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/ElrondNetwork/elrond-go fixed: 1.3.35
Upgrade github.com/ElrondNetwork/elrond-go to 1.3.35
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/ElrondNetwork/elrond-go

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-36061, inspect your project dependencies for Github.com/ElrondNetwork/elrond go:

inspect dependencies for github.com/ElrondNetwork/elrond-go

Analyze the terminal output to locate any version of Github.com/ElrondNetwork/elrond go in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.35), 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-665: Improper Initialization, where the product does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used. In Github.com/ElrondNetwork/elrond 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 Read only calls between contracts can generate smart contracts results. For example, if contract A calls in read only mode contract B and the called function will make changes upon the contract's B state, the state will be altered for contract B as if the call was not made in the read-only mode. This can lead to some effects not designed by the original smart contracts programmers. ### Patches Patch v1.3.35 or higher ### Workarounds No workaround ### References For future reference and understanding of this issue, anyone can check this integration test https://github.com/ElrondNetwork/elrond-go/blob/8e402fa6d7e91e779980122d3798b2bf50892945/integrationTests/vm/txsFee/asyncESDT_test.go#L452 that proves the fix and prevents a future code regression. ### For more information If you have any questions or comments about this advisory: * Open an issue in elrond-go ([http://github.com/ElrondNetwork/elrond-go/issues](https://github.com/ElrondNetwork/elrond-go/issues))

CVE-2022-36061 Affected Github.com/ElrondNetwork/elrond go Versions

1 component(s)
Fixed Versions:
1.3.35
Product / Package Ecosystem Affected Versions Fixed Version
github.com/ElrondNetwork/elrond-go
Go
< 1.3.35
1.3.35

References

Frequently Asked Questions

What is CVE-2022-36061?
CVE-2022-36061 is a security vulnerability in Github.com/ElrondNetwork/elrond go involving Elrond-go has improper initialization under CWE-665: Improper Initialization.
Which Github.com/ElrondNetwork/elrond go versions are affected?
Affected versions include releases prior to 1.3.35 across affected packages: github.com/ElrondNetwork/elrond-go.
What version fixes CVE-2022-36061?
Upgrading to 1.3.35 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ElrondNetwork/elrond-go affected?
Yes, github.com/ElrondNetwork/elrond-go is affected in releases prior to 1.3.35. Upgrade your dependency to 1.3.35 or later.
What is the CVSS score of CVE-2022-36061?
CVE-2022-36061 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-36061?
CVE-2022-36061 is classified under CWE-665: Improper Initialization (The product does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used.).
How can I check Go dependencies for CVE-2022-36061?
Run the dependency tree command: 'inspect dependencies for github.com/ElrondNetwork/elrond-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-mv8x-668m-53fg",
  "modified" : "2022-09-16T21:21:43Z",
  "published" : "2022-09-16T21:21:43Z",
  "aliases" : [ "CVE-2022-36061" ],
  "summary" : "Elrond-go has improper initialization",
  "details" : "### Impact\nRead only calls between contracts can generate smart contracts results. For example, if contract A calls in read only mode contract B and the called function will make changes upon the contract's B state, the state will be altered for contract B as if the call was not made in the read-only mode. This can lead to some effects not designed by the original smart contracts programmers.\n\n### Patches\nPatch v1.3.35 or higher\n\n### Workarounds\nNo workaround\n\n### References\nFor future reference and understanding of this issue, anyone can check this integration test https://github.com/ElrondNetwork/elrond-go/blob/8e402fa6d7e91e779980122d3798b2bf50892945/integrationTests/vm/txsFee/asyncESDT_test.go#L452 that proves the fix and prevents a future code regression. \n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in elrond-go ([http://github.com/ElrondNetwork/elrond-go/issues](https://github.com/ElrondNetwork/elrond-go/issues))\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ElrondNetwork/elrond-go"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.35"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.3.34"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ElrondNetwork/elrond-go/security/advisories/GHSA-mv8x-668m-53fg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-36061"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ElrondNetwork/elrond-go"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ElrondNetwork/elrond-go/blob/8e402fa6d7e91e779980122d3798b2bf50892945/integrationTests/vm/txsFee/asyncESDT_test.go#L452"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ElrondNetwork/elrond-go/releases/tag/v1.3.35"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-665" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-16T21:21:43Z",
    "nvd_published_at" : "2022-09-06T21:15:00Z"
  }
}