CVE-2021-4239 Weak encryption and denial of service in github.com/flynn/noise
Weak encryption after massive message counts and nonce desynchronization allow denial of service and security bypass in the Go Noise protocol library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-4239?
CVE-2021-4239 is a high-severity vulnerability in github.com/flynn/noise, published on 27 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
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.
Weakness: CWE-311
Which versions are affected by CVE-2021-4239?
5 open source packages ship an affected version, including github.com/flynn/noise. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/flynn/noise Go | All versions | 1.0.0 |
github.com/flynn/noise Go | All versions | 1.0.0 |
github.com/flynn/noise Go | All versions | 1.0.0 |
github.com/flynn/noise Go | All versions | 1.0.0 |
github.com/flynn/noise Go | All versions | 1.0.0 |
Products include Noiseprotocol Noise.
How do I fix CVE-2021-4239?
Upgrade github.com/flynn/noise to 1.0.0 or later.
Is CVE-2021-4239 being exploited?
There is no known exploitation of CVE-2021-4239 in the wild and no public exploit code.
Sources
Also known as GHSA-6cr6-fmvc-vw2p, GHSA-g9mp-8g3h-3c5c, GO-2022-0425, UBUNTU-CVE-2021-4239.