CVE-2026-39892: Cryptography Cryptography Vulnerable To Buffer Overflow Vulnerability

MODERATE
Advisory Identifier: GHSA-p423-j2cm-9vmq
CWE-119
Published
Advisory Summary

CVE-2026-39892 is a MODERATE cryptography vulnerable to buffer overflow vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Cryptography libraries in the PyPI ecosystem. The issue involves cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to apis. Remediation is available by upgrading affected packages to version 46.0.7.

CVE-2026-39892 at a Glance

CVE Identifier CVE-2026-39892
GHSA Identifier GHSA-p423-j2cm-9vmq
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
Affected Product Cryptography
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-39892

To remediate this vulnerability, upgrade all affected Cryptography dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

cryptography fixed: 46.0.7
pip install cryptography>=46.0.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show cryptography

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-39892, inspect your installed packages using pip:

pip show cryptography

Analyze the terminal output to locate any version of Cryptography in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 46.0.7), your application is affected.

Note: The pip show cryptography command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. In Cryptography, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

If a non-contiguous buffer was passed to APIs which accepted Python buffers (e.g. `Hash.update()`), this could lead to buffer overflows. For example: ```python h = Hash(SHA256()) b.update(buf[::-1]) ``` would read past the end of the buffer on Python >3.11

CVE-2026-39892 Affected Cryptography Versions

1 component(s)
Fixed Versions:
46.0.7
Product / Package Ecosystem Affected Versions Fixed Version
cryptography
PyPI
≥ 45.0.0
< 46.0.7
46.0.7

References

Frequently Asked Questions

What is CVE-2026-39892?
CVE-2026-39892 is a security vulnerability in Cryptography involving Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer.
Which Cryptography versions are affected?
Affected versions include releases prior to 46.0.7 across affected packages: cryptography.
What version fixes CVE-2026-39892?
Upgrading to 46.0.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cryptography affected?
Yes, cryptography is affected in releases prior to 46.0.7. Upgrade your dependency to 46.0.7 or later.
What CWE is associated with CVE-2026-39892?
CVE-2026-39892 is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer (The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.).
How can I check PyPI dependencies for CVE-2026-39892?
Run the dependency tree command: 'pip show cryptography'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p423-j2cm-9vmq",
  "modified" : "2026-06-05T17:52:21Z",
  "published" : "2026-04-08T19:23:08Z",
  "aliases" : [ "CVE-2026-39892" ],
  "summary" : "Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs",
  "details" : "If a non-contiguous buffer was passed to APIs which accepted Python buffers (e.g. `Hash.update()`), this could lead to buffer overflows. For example:\n\n```python\nh = Hash(SHA256())\nb.update(buf[::-1])\n```\n\nwould read past the end of the buffer on Python >3.11",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "cryptography"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "45.0.0"
      }, {
        "fixed" : "46.0.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/security/advisories/GHSA-p423-j2cm-9vmq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39892"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyca/cryptography"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2026-36.yaml"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2026/04/08/12"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-119" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-08T19:23:08Z",
    "nvd_published_at" : "2026-04-08T21:17:01Z"
  }
}