Vulnerability · Published Dec 27, 2022 · Assigned by Go

CVE-2021-4239Weak encryption and denial of service in github.com/flynn/noise

High 7.5

In plain English

A high-severity security flaw in github.com/flynn/noise from github.com/flynn/noise. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 32% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)0.4%top 68.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Gogithub.com/flynn/noise1.0.0GHSA-6cr6-fmvc-vw2p
Gogithub.com/flynn/noise1.0.0GHSA-g9mp-8g3h-3c5c
Gogithub.com/flynn/noise1.0.0GO-2022-0425
Ubuntu:22.04:LTSgolang-github-flynn-noiseno fix listedUBUNTU-CVE-2021-4239
Ubuntu:24.04:LTSgolang-github-flynn-noiseno fix listedUBUNTU-CVE-2021-4239
Ubuntu:25.10golang-github-flynn-noiseno fix listedUBUNTU-CVE-2021-4239
Ubuntu:26.04:LTSgolang-github-flynn-noiseno fix listedUBUNTU-CVE-2021-4239
Ubuntu:26.10golang-github-flynn-noiseno fix listedUBUNTU-CVE-2021-4239

Affected products (as reported)

VendorProductVersions
github.com/flynn/noise github.com/flynn/noise 0 – before 1.0.0

References