CVE-2021-3538: Github.com/satori/go.uuid Go.uuid Has Predictable UUID Identifiers Vulnerability

CRITICAL
Advisory Identifier: GHSA-33m6-q9v5-62r7
CVSS 9.8
CWE-338
Published
Advisory Summary

CVE-2021-3538 is a CRITICAL (CVSS 9.8) go.uuid has predictable uuid identifiers vulnerability (CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)) affecting Github.com/satori/go.uuid libraries in the Go ecosystem. The issue involves go.uuid has predictable uuid identifiers. Remediation is available by upgrading affected packages to version 1.2.1-0.20180404165556-75cca531ea76.

CVE-2021-3538 at a Glance

CVE Identifier CVE-2021-3538
GHSA Identifier GHSA-33m6-q9v5-62r7
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
Affected Product Github.com/satori/go.uuid
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-2021-3538

To remediate this vulnerability, upgrade all affected Github.com/satori/go.uuid 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/satori/go.uuid fixed: 1.2.1-0.20180404165556-75cca531ea76
Upgrade github.com/satori/go.uuid to 1.2.1-0.20180404165556-75cca531ea76
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/satori/go.uuid

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-3538, inspect your project dependencies for Github.com/satori/go.uuid:

inspect dependencies for github.com/satori/go.uuid

Analyze the terminal output to locate any version of Github.com/satori/go.uuid in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.1-0.20180404165556-75cca531ea76), 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-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG), where the product uses a pseudo-random number generator (prng) in a security context, but the prng's algorithm is not cryptographically strong. In Github.com/satori/go.uuid, 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

### CVE Description for go.uuid A flaw was found in github.com/satori/go.uuid in versions from commit 0ef6afb2f6cdd6cdaeee3885a95099c63f18fc8c to d91630c8510268e75203009fe7daf2b8e1d60c45. Due to insecure randomness in the g.rand.Read function the generated UUIDs are predictable for an attacker. ### Update on 19 September 2024 -- This vulnerability never existed in sif The [official NIST CVE-2021-3538 record](https://nvd.nist.gov/vuln/detail/CVE-2021-3538) says: > A flaw was found in github.com/satori/go.uuid in versions from commit 0ef6afb2f6cdd6cdaeee3885a95099c63f18fc8c to d91630c8510268e75203009fe7daf2b8e1d60c45. That commit and that fix were never in a tagged release of satori/go.uuid, and prior to this announcement sif had used the last tag, 1.2.0. The NIST record says version 1.2.0 was vulnerable, but that's not true. So sif was never vulnerable to this. Also, beginning with version 2.0.0, sif does not use satori/go.uuid anymore. This update was made in response to issue #243 which has more details. The original, incorrect sif vulnerability description is below. ------------- ### Impact The siftool new command produces predictable UUID identifiers due to insecure randomness in the version of the `github.com/satori/go.uuid` module used as a dependency. ### Patches A patch is available in version >= v1.2.2 of the module. Users are encouraged to upgrade. Fixed by https://github.com/hpcng/sif/pull/90 ### Workarounds Users passing CreateInfo struct should ensure the ID field is generated using a version of github.com/satori/go.uuid that is not vulnerable to this issue. Unfortunately, the latest tagged release is vulnerable to this issue. One way to obtain a non-vulnerable version is: `go get -u github.com/satori/go.uuid@v1.2.1-0.20180404165556-75cca531ea76` ### References https://github.com/satori/go.uuid/issues/73 ### For more information If you have any questions or comments about this advisory: Open an issue in https://github.com/hpcng/sif/issues

CVE-2021-3538 Affected Github.com/satori/go.uuid Versions

1 component(s)
Fixed Versions:
1.2.1-0.20180404165556-75cca531ea76
Product / Package Ecosystem Affected Versions Fixed Version
github.com/satori/go.uuid
Go
≥ 1.2.1-0.20180103161547-0ef6afb2f6cd
< 1.2.1-0.20180404165556-75cca531ea76
1.2.1-0.20180404165556-75cca531ea76

References

Frequently Asked Questions

What is CVE-2021-3538?
CVE-2021-3538 is a security vulnerability in Github.com/satori/go.uuid involving go.uuid has Predictable UUID Identifiers under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG).
Which Github.com/satori/go.uuid versions are affected?
Affected versions include releases prior to 1.2.1-0.20180404165556-75cca531ea76 across affected packages: github.com/satori/go.uuid.
What version fixes CVE-2021-3538?
Upgrading to 1.2.1-0.20180404165556-75cca531ea76 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/satori/go.uuid affected?
Yes, github.com/satori/go.uuid is affected in releases prior to 1.2.1-0.20180404165556-75cca531ea76. Upgrade your dependency to 1.2.1-0.20180404165556-75cca531ea76 or later.
What is the CVSS score of CVE-2021-3538?
CVE-2021-3538 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-2021-3538?
CVE-2021-3538 is classified under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) (The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG's algorithm is not cryptographically strong.).
How can I check Go dependencies for CVE-2021-3538?
Run the dependency tree command: 'inspect dependencies for github.com/satori/go.uuid'. 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-33m6-q9v5-62r7",
  "modified" : "2024-09-19T13:39:25Z",
  "published" : "2023-02-07T22:57:53Z",
  "aliases" : [ "CVE-2021-3538" ],
  "summary" : "go.uuid has Predictable UUID Identifiers",
  "details" : "### CVE Description for go.uuid\nA flaw was found in github.com/satori/go.uuid in versions from commit 0ef6afb2f6cdd6cdaeee3885a95099c63f18fc8c to d91630c8510268e75203009fe7daf2b8e1d60c45. Due to insecure randomness in the g.rand.Read function the generated UUIDs are predictable for an attacker.\n\n### Update on 19 September 2024 -- This vulnerability never existed in sif\n\nThe [official NIST CVE-2021-3538 record](https://nvd.nist.gov/vuln/detail/CVE-2021-3538) says:\n\n> A flaw was found in github.com/satori/go.uuid in versions from commit 0ef6afb2f6cdd6cdaeee3885a95099c63f18fc8c to d91630c8510268e75203009fe7daf2b8e1d60c45. \n\nThat commit and that fix were never in a tagged release of satori/go.uuid, and prior to this announcement sif had used the last tag, 1.2.0.  The NIST record says version 1.2.0 was vulnerable, but that's not true.   So sif was never vulnerable to this.  Also, beginning with version 2.0.0, sif does not use satori/go.uuid anymore.\n\nThis update was made in response to issue #243 which has more details.\n\nThe original, incorrect sif vulnerability description is below.\n\n-------------\n\n### Impact\n\nThe siftool new command produces predictable UUID identifiers due to insecure randomness in the version of the `github.com/satori/go.uuid` module used as a dependency.\n\n### Patches\n\nA patch is available in version >= v1.2.2 of the module. Users are encouraged to upgrade.\n\nFixed by https://github.com/hpcng/sif/pull/90\n\n### Workarounds\n\nUsers passing CreateInfo struct should ensure the ID field is generated using a version of github.com/satori/go.uuid that is not vulnerable to this issue. Unfortunately, the latest tagged release is vulnerable to this issue. One way to obtain a non-vulnerable version is:\n\n`go get -u github.com/satori/go.uuid@v1.2.1-0.20180404165556-75cca531ea76`\n\n### References\n\nhttps://github.com/satori/go.uuid/issues/73\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\nOpen an issue in https://github.com/hpcng/sif/issues",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/satori/go.uuid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.1-0.20180103161547-0ef6afb2f6cd"
      }, {
        "fixed" : "1.2.1-0.20180404165556-75cca531ea76"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/apptainer/sif/security/advisories/GHSA-33m6-q9v5-62r7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hpcng/sif/security/advisories/GHSA-33m6-q9v5-62r7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3538"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/satori/go.uuid/issues/73"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/satori/go.uuid/pull/75"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/satori/go.uuid/commit/75cca531ea763666bc46e531da3b4c3b95f64557"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1954376"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/satori/go.uuid"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0244"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-GOLANG-GITHUBCOMSATORIGOUUID-72488"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-338" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-07T22:57:53Z",
    "nvd_published_at" : "2021-06-02T14:15:00Z"
  }
}