Improper nonce handling in github.com/flynn/noise: potential overflow, potential state DoS
Summary
CVE-2021-4239: flynn/noise has improper nonce handling yielding potential state DoS. Affects github.com/flynn/noise versions < 1.0.0. Fixed in 1.0.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The package github.com/flynn/noise is a Go implementation of the Noise Protocol, which is a framework for building secure communication protocols. It provides cryptographic primitives and a handshake pattern for establishing secure channels between two parties. The package is widely used in various applications that require secure communication.
Vulnerability Detail
The package github.com/flynn/noise has two vulnerabilities related to nonce handling:
-
Potential nonce overflow: If a large number of messages are encrypted after handshaking, the nonce counter can wrap around, resulting in multiple messages being encrypted with the same key and nonce. This weakens the security properties of the symmetric cipher used for encryption.
-
Potential denial of service (DoS) via invalid ciphertext: If an attacker sends invalid ciphertext to one peer's Decrypt function, the nonce is incremented unconditionally. This causes a desynchronization of the CipherState between the peers, leading to a failure to decrypt subsequent messages.
Both vulnerabilities have been fixed in version 1.0.0 of the package.
How To Fix
Latest published version: v1.1.0 as of 22 Oct 2026
go get github.com/flynn/noise@v1.1.0
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.0.0
This is the first release that contains the fix.
go get github.com/flynn/noise@v1.0.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for these vulnerabilities. It is recommended to update to the fixed version as soon as possible.
Conclusion
The package github.com/flynn/noise had two vulnerabilities related to nonce handling, which could lead to a potential nonce overflow and a denial of service (DoS) via invalid ciphertext. These vulnerabilities have been fixed in version 1.0.0 of the package. It is recommended to update to the fixed version to ensure the security of your application. If you need further assistance or support in addressing these vulnerabilities, you can reach out to DevNack.com.
See every vulnerability recorded for github.com/flynn/noise →
FAQ
The nonce overflow vulnerability can result in multiple messages being encrypted with the same key and nonce, which weakens the security of the encryption. This can potentially allow an attacker to decrypt the messages or perform other cryptographic attacks.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by these vulnerabilities. Simply provide the path to your Gopkg.lock file, and Vulert will analyze it for any open-source vulnerabilities, including this one.
Yes, the vulnerabilities have been fixed in version 1.0.0 of the package github.com/flynn/noise. It is recommended to update to this version or later to mitigate the vulnerabilities.
No, there are no known workarounds for these vulnerabilities. Updating to the fixed version is the recommended solution.
These vulnerabilities were discovered during an audit of a user of the package github.com/flynn/noise. The audit was commissioned by UC Berkeley, and the fixes were collaboratively developed by David Fifield, Nathan Brown, and the package maintainers.