Vulnerabilities in pkg:golang/github.com/holiman/uint256

PACKAGE
Advisory Identifier: GHSA-jm5c-rv3w-w83m
Advisory Summary

CVE-2020-26242 is a MODERATE (CVSS 6.5) denial of service vulnerability (CWE-191: Integer Underflow (Wrap or Wraparound)) affecting Github.com/ethereum/go ethereum libraries in the Go ecosystem. The issue involves denial of service in geth. Remediation is available by upgrading affected packages to version 1.9.18, 1.1.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/holiman/uint256

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/holiman/uint256. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-jm5c-rv3w-w83m CVE-2020-26242 MODERATE Denial of service in geth

CVE-2020-26242 at a Glance

CVE Identifier CVE-2020-26242
GHSA Identifier GHSA-jm5c-rv3w-w83m
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-191: Integer Underflow (Wrap or Wraparound)
Affected Product Github.com/ethereum/go ethereum
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2020-26242

To remediate this vulnerability, upgrade all affected Github.com/ethereum/go ethereum 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/ethereum/go-ethereum fixed: 1.9.18
Upgrade github.com/ethereum/go-ethereum to 1.9.18
github.com/holiman/uint256 fixed: 1.1.1
Upgrade github.com/holiman/uint256 to 1.1.1
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/ethereum/go-ethereum

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-26242, inspect your project dependencies for Github.com/ethereum/go ethereum:

inspect dependencies for github.com/ethereum/go-ethereum

Analyze the terminal output to locate any version of Github.com/ethereum/go ethereum in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.18), 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-191: Integer Underflow (Wrap or Wraparound), where the product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result. In Github.com/ethereum/go ethereum, 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 Denial-of-service (crash) during block processing ### Details Affected versions suffer from a vulnerability which can be exploited through the `MULMOD` operation, by specifying a modulo of `0`: `mulmod(a,b,0)`, causing a `panic` in the underlying library. The crash was in the `uint256` library, where a buffer [underflowed](https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L442). if `d == 0`, `dLen` remains `0` and https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L451 will try to access index `[-1]`. The `uint256` library was first merged in this [commit](https://github.com/ethereum/go-ethereum/commit/cf6674539c589f80031f3371a71c6a80addbe454), on 2020-06-08. Exploiting this vulnerabilty would cause all vulnerable nodes to drop off the network. The issue was brought to our attention through a [bug report](https://github.com/ethereum/go-ethereum/issues/21367), showing a `panic` occurring on sync from genesis on the Ropsten network. It was estimated that the least obvious way to fix this would be to merge the fix into `uint256`, make a new release of that library and then update the geth-dependency. - https://github.com/holiman/uint256/releases/tag/v1.1.1 was made the same day, - PR to address the issue: https://github.com/holiman/uint256/pull/80 - PR to update geth deps: https://github.com/ethereum/go-ethereum/pull/21368 ### Patches Upgrade to v1.9.18 or higher ### Workarounds Not at this time ### References https://blog.ethereum.org/2020/11/12/geth_security_release/ ### For more information If you have any questions or comments about this advisory: * Open an issue in [go-ethereum](https://github.com/ethereum/go-ethereum) * Email us at [security@ethereum.org](mailto:security@ethereum.org)

CVE-2020-26242 Affected Github.com/ethereum/go ethereum Versions

2 component(s)
Fixed Versions:
1.9.181.1.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/ethereum/go-ethereum
Go
≥ 1.9.16
< 1.9.18
1.9.18
github.com/holiman/uint256
Go
≥ 0.1.0
< 1.1.1
1.1.1

References

Frequently Asked Questions

What is CVE-2020-26242?
CVE-2020-26242 is a security vulnerability in Github.com/ethereum/go ethereum involving Denial of service in geth under CWE-191: Integer Underflow (Wrap or Wraparound).
Which Github.com/ethereum/go ethereum versions are affected?
Affected versions include releases prior to 1.9.18, 1.1.1 across affected packages: github.com/ethereum/go-ethereum, github.com/holiman/uint256.
What version fixes CVE-2020-26242?
Upgrading to 1.9.18, 1.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ethereum/go-ethereum affected?
Yes, github.com/ethereum/go-ethereum is affected in releases prior to 1.9.18. Upgrade your dependency to 1.9.18 or later.
Is github.com/holiman/uint256 affected?
Yes, github.com/holiman/uint256 is affected in releases prior to 1.1.1. Upgrade your dependency to 1.1.1 or later.
What is the CVSS score of CVE-2020-26242?
CVE-2020-26242 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2020-26242?
CVE-2020-26242 is classified under CWE-191: Integer Underflow (Wrap or Wraparound) (The product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result.).
How can I check Go dependencies for CVE-2020-26242?
Run the dependency tree command: 'inspect dependencies for github.com/ethereum/go-ethereum'. 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-jm5c-rv3w-w83m",
  "modified" : "2025-01-30T14:38:53Z",
  "published" : "2021-06-29T21:13:20Z",
  "aliases" : [ "CVE-2020-26242" ],
  "summary" : "Denial of service in geth",
  "details" : "### Impact\nDenial-of-service (crash) during block processing\n\n### Details\n\nAffected versions suffer from a vulnerability which can be exploited through the `MULMOD` operation, by specifying a modulo of `0`: `mulmod(a,b,0)`, causing a `panic` in the underlying library. \nThe crash was in the `uint256` library, where a buffer [underflowed](https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L442).\n\n\tif `d == 0`, `dLen` remains `0`\n\nand https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L451 will try to access index `[-1]`.\n\nThe `uint256` library was first merged in this [commit](https://github.com/ethereum/go-ethereum/commit/cf6674539c589f80031f3371a71c6a80addbe454), on 2020-06-08. \nExploiting this vulnerabilty would cause all vulnerable nodes to drop off the network. \n\nThe issue was brought to our attention through a [bug report](https://github.com/ethereum/go-ethereum/issues/21367), showing a `panic` occurring on sync from genesis on the Ropsten network.\n \nIt was estimated that the least obvious way to fix this would be to merge the fix into `uint256`, make a new release of that library and then update the geth-dependency.\n\n- https://github.com/holiman/uint256/releases/tag/v1.1.1 was made the same day, \n- PR to address the issue: https://github.com/holiman/uint256/pull/80 \n- PR to update geth deps: https://github.com/ethereum/go-ethereum/pull/21368 \n\n\n\n### Patches\n\nUpgrade to v1.9.18 or higher\n\n### Workarounds\n\nNot at this time\n\n### References\n\nhttps://blog.ethereum.org/2020/11/12/geth_security_release/\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [go-ethereum](https://github.com/ethereum/go-ethereum)\n* Email us at [security@ethereum.org](mailto:security@ethereum.org)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ethereum/go-ethereum"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.9.16"
      }, {
        "fixed" : "1.9.18"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/holiman/uint256"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "1.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ethereum/go-ethereum/security/advisories/GHSA-jm5c-rv3w-w83m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-26242"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/holiman/uint256/pull/80"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ethereum/go-ethereum/commit/7163a6664ee664df81b9028ab3ba13b9d65a7196"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/holiman/uint256/commit/6785da6e3eea403260a5760029e722aa4ff1716d"
  }, {
    "type" : "WEB",
    "url" : "https://blog.ethereum.org/2020/11/12/geth_security_release"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ethereum/go-ethereum"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2021-0103"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125", "CWE-191", "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-21T21:50:44Z",
    "nvd_published_at" : null
  }
}