CVE-2026-39892: Cryptography Package Buffer Overflow Vulnerability

cryptography Updated 08 Apr 2026

Summary

08/04/2026
Yes i
Moderate
6.9

CVE-2026-39892: Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs. Affects cryptography versions >= 45.0.0, < 46.0.7. Fixed in 46.0.7. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The 'cryptography' package is a widely used library in Python that provides cryptographic recipes and primitives to developers. It enables secure communication and data protection through various cryptographic algorithms. However, it has been identified that certain APIs within this package are vulnerable to buffer overflow when non-contiguous buffers are passed, particularly affecting versions prior to 46.0.7.

Vulnerability Detail

The vulnerability arises when non-contiguous buffers are passed to APIs that accept Python buffers, such as the Hash.update() method. This can lead to buffer overflows, where the program reads beyond the allocated memory, potentially causing crashes or allowing attackers to execute arbitrary code. For instance, using the following code snippet could trigger the vulnerability:

h = Hash(SHA256())
b.update(buf[::-1])

This issue is particularly critical in Python versions greater than 3.11, where the risk of reading past the end of the buffer is heightened.

How To Fix

Latest published version: 50.0.2 as of 22 Oct 2026

pip install --upgrade "cryptography==50.0.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

46.0.7

This is the first release that contains the fix.

pip install --upgrade "cryptography==46.0.7"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid passing non-contiguous buffers to the affected APIs. Ensure that the buffers you pass are contiguous to prevent triggering the buffer overflow. For example, instead of using:

h.update(buf[::-1])

use:

h.update(buf)

Conclusion

In summary, CVE-2026-39892 presents a buffer overflow vulnerability in the 'cryptography' package, which can be mitigated by updating to version 46.0.7 or later. It is crucial for developers to ensure they are using the latest version to maintain the security of their applications.

See every vulnerability recorded for cryptography →

Share this vulnerability

FAQ

CVE-2026-39892 is a vulnerability in the 'cryptography' package that can lead to buffer overflow when non-contiguous buffers are passed to certain APIs.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which allows you to monitor and alert for open-source vulnerabilities without requiring signup.

The consequences include application crashes and the potential for arbitrary code execution, which can compromise the security of your application.

You can update the package by running the command 'pip install --upgrade cryptography' in your terminal.

The CVSS score of this vulnerability is 6.9, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for cryptography.

How To Fix

Latest published version: 50.0.2 as of 22 Oct 2026

pip install --upgrade "cryptography==50.0.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

46.0.7

This is the first release that contains the fix.

pip install --upgrade "cryptography==46.0.7"

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