Improper nonce handling in github.com/flynn/noise: potential overflow, potential state DoS

github.com/flynn/noise Updated 02 Oct 2025

Summary

15/02/2022
Yes i
Moderate
7.7

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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:

  1. 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.

  2. 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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback