CVE-2023-50782: Cryptography Python Cryptography Package Vulnerable To Vulnerability

HIGH
Advisory Identifier: GHSA-3ww4-gg4f-jr7f
CVSS 7.5
CWE-203 CWE-385 CWE-208
Published
Advisory Summary

CVE-2023-50782 is a HIGH (CVSS 7.5) python cryptography package vulnerable to vulnerability (CWE-203: Observable Discrepancy) affecting Cryptography libraries in the PyPI ecosystem. The issue involves python cryptography package vulnerable to bleichenbacher timing oracle attack. Remediation is available by upgrading affected packages to version 42.0.0.

CVE-2023-50782 at a Glance

CVE Identifier CVE-2023-50782
GHSA Identifier GHSA-3ww4-gg4f-jr7f
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-203: Observable Discrepancy
Affected Product Cryptography
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2023-50782

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: 42.0.0
pip install cryptography>=42.0.0
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-2023-50782, 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 42.0.0), 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-203: Observable Discrepancy, where the product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor. 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

A flaw was found in the python-cryptography package. This issue may allow a remote attacker to decrypt captured messages in TLS servers that use RSA key exchanges, which may lead to exposure of confidential or sensitive data.

CVE-2023-50782 Affected Cryptography Versions

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

References

Frequently Asked Questions

What is CVE-2023-50782?
CVE-2023-50782 is a security vulnerability in Cryptography involving Python Cryptography package vulnerable to Bleichenbacher timing oracle attack under CWE-203: Observable Discrepancy.
Which Cryptography versions are affected?
Affected versions include releases prior to 42.0.0 across affected packages: cryptography.
What version fixes CVE-2023-50782?
Upgrading to 42.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cryptography affected?
Yes, cryptography is affected in releases prior to 42.0.0. Upgrade your dependency to 42.0.0 or later.
What is the CVSS score of CVE-2023-50782?
CVE-2023-50782 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2023-50782?
CVE-2023-50782 is classified under CWE-203: Observable Discrepancy (The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.).
How can I check PyPI dependencies for CVE-2023-50782?
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-3ww4-gg4f-jr7f",
  "modified" : "2026-02-27T20:57:35Z",
  "published" : "2024-02-05T21:30:31Z",
  "aliases" : [ "CVE-2023-50782" ],
  "summary" : "Python Cryptography package vulnerable to Bleichenbacher timing oracle attack",
  "details" : "A flaw was found in the python-cryptography package. This issue may allow a remote attacker to decrypt captured messages in TLS servers that use RSA key exchanges, which may lead to exposure of confidential or sensitive data.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "cryptography"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "42.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-50782"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/issues/9785"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2023-50782"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2254432"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyca/cryptography"
  }, {
    "type" : "WEB",
    "url" : "https://www.couchbase.com/alerts"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-203", "CWE-208", "CWE-385" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-05T23:04:50Z",
    "nvd_published_at" : "2024-02-05T21:15:11Z"
  }
}