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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Go | github.com/flynn/noise | 1.0.0 | GHSA-6cr6-fmvc-vw2p |
| Go | github.com/flynn/noise | 1.0.0 | GHSA-g9mp-8g3h-3c5c |
| Go | github.com/flynn/noise | 1.0.0 | GO-2022-0425 |
| Ubuntu:22.04:LTS | golang-github-flynn-noise | no fix listed | UBUNTU-CVE-2021-4239 |
| Ubuntu:24.04:LTS | golang-github-flynn-noise | no fix listed | UBUNTU-CVE-2021-4239 |
| Ubuntu:25.10 | golang-github-flynn-noise | no fix listed | UBUNTU-CVE-2021-4239 |
| Ubuntu:26.04:LTS | golang-github-flynn-noise | no fix listed | UBUNTU-CVE-2021-4239 |
| Ubuntu:26.10 | golang-github-flynn-noise | no fix listed | UBUNTU-CVE-2021-4239 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| github.com/flynn/noise | github.com/flynn/noise | 0 – before 1.0.0 |