CVE-2021-4239: Github.com/flynn/noise Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-6cr6-fmvc-vw2p
CVSS 7.7
CWE-311
Published
Advisory Summary

CVE-2021-4239 is a HIGH (CVSS 7.7) denial of service vulnerability (CWE-311: Missing Encryption of Sensitive Data) affecting Github.com/flynn/noise libraries in the Go ecosystem. The issue involves noise vulnerable to denial of service. Remediation is available by upgrading affected packages to version 1.0.0.

CVE-2021-4239 at a Glance

CVE Identifier CVE-2021-4239
GHSA Identifier GHSA-6cr6-fmvc-vw2p
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-311: Missing Encryption of Sensitive Data
Affected Product Github.com/flynn/noise
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.7

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

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

How to Fix CVE-2021-4239

To remediate this vulnerability, upgrade all affected Github.com/flynn/noise 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/flynn/noise fixed: 1.0.0
Upgrade github.com/flynn/noise to 1.0.0
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/flynn/noise

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-4239, inspect your project dependencies for Github.com/flynn/noise:

inspect dependencies for github.com/flynn/noise

Analyze the terminal output to locate any version of Github.com/flynn/noise in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0), 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-311: Missing Encryption of Sensitive Data, where the product does not encrypt sensitive or critical information before storage or transmission. In Github.com/flynn/noise, 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

Noise is a Go implementation of the Noise Protocol Framework. The Noise protocol implementation suffers from weakened cryptographic security after encrypting 2^64 messages, and a potential denial of service attack. After 2^64 (~18.4 quintillion) messages are encrypted with the Encrypt function, the nonce counter will wrap around, causing multiple messages to be encrypted with the same key and nonce. In a separate issue, the Decrypt function increments the nonce state even when it fails to decrypt a message. If an attacker can provide an invalid input to the Decrypt function, this will cause the nonce state to desynchronize between the peers, resulting in a failure to encrypt all subsequent messages.

CVE-2021-4239 Affected Github.com/flynn/noise Versions

1 component(s)
Fixed Versions:
1.0.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/flynn/noise
Go
< 1.0.0
1.0.0

References

Frequently Asked Questions

What is CVE-2021-4239?
CVE-2021-4239 is a security vulnerability in Github.com/flynn/noise involving Noise vulnerable to denial of service under CWE-311: Missing Encryption of Sensitive Data.
Which Github.com/flynn/noise versions are affected?
Affected versions include releases prior to 1.0.0 across affected packages: github.com/flynn/noise.
What version fixes CVE-2021-4239?
Upgrading to 1.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/flynn/noise affected?
Yes, github.com/flynn/noise is affected in releases prior to 1.0.0. Upgrade your dependency to 1.0.0 or later.
What is the CVSS score of CVE-2021-4239?
CVE-2021-4239 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:H.
What CWE is associated with CVE-2021-4239?
CVE-2021-4239 is classified under CWE-311: Missing Encryption of Sensitive Data (The product does not encrypt sensitive or critical information before storage or transmission.).
How can I check Go dependencies for CVE-2021-4239?
Run the dependency tree command: 'inspect dependencies for github.com/flynn/noise'. 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-6cr6-fmvc-vw2p",
  "modified" : "2023-02-09T21:41:23Z",
  "published" : "2022-12-28T00:30:23Z",
  "aliases" : [ "CVE-2021-4239" ],
  "summary" : "Noise vulnerable to denial of service",
  "details" : "Noise is a Go implementation of the Noise Protocol Framework. The Noise protocol implementation suffers from weakened cryptographic security after encrypting 2^64 messages, and a potential denial of service attack. After 2^64 (~18.4 quintillion) messages are encrypted with the Encrypt function, the nonce counter will wrap around, causing multiple messages to be encrypted with the same key and nonce. In a separate issue, the Decrypt function increments the nonce state even when it fails to decrypt a message. If an attacker can provide an invalid input to the Decrypt function, this will cause the nonce state to desynchronize between the peers, resulting in a failure to encrypt all subsequent messages.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/flynn/noise"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-4239"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flynn/noise/pull/44"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flynn/noise/commit/2499bf1bad239a8316c32932a993642350b3afdb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/flynn/noise"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0425"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-311" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-29T01:52:11Z",
    "nvd_published_at" : "2022-12-27T22:15:00Z"
  }
}