CVE-2023-0286: Cryptography Vulnerable OpenSSL Included Vulnerability

HIGH
Advisory Identifier: GHSA-x4qr-2fvf-3mr5
CVSS 7.4
CWE-843
Published
Advisory Summary

CVE-2023-0286 is a HIGH (CVSS 7.4) vulnerable openssl included vulnerability (CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')) affecting Cryptography libraries in the PyPI ecosystem. The issue involves vulnerable openssl included in cryptography wheels. Remediation is available by upgrading affected packages to version 39.0.1, 111.25.0, 300.0.12.

CVE-2023-0286 at a Glance

CVE Identifier CVE-2023-0286
GHSA Identifier GHSA-x4qr-2fvf-3mr5
Severity HIGH
CVSS v3.1 Base Score 7.4
CWE Classification CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')
Affected Product Cryptography
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.4

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

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

How to Fix CVE-2023-0286

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: 39.0.1
pip install cryptography>=39.0.1
openssl-src fixed: 111.25.0
Upgrade openssl-src to 111.25.0
openssl-src fixed: 300.0.12
Upgrade openssl-src to 300.0.12
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-0286, 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 39.0.1), 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-843: Access of Resource Using Incompatible Type ('Type Confusion'), where the product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. 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

pyca/cryptography's wheels include a statically linked copy of OpenSSL. The versions of OpenSSL included in cryptography 0.8.1-39.0.0 are vulnerable to a security issue. More details about the vulnerabilities themselves can be found in https://www.openssl.org/news/secadv/20221213.txt and https://www.openssl.org/news/secadv/20230207.txt. If you are building cryptography source ("sdist") then you are responsible for upgrading your copy of OpenSSL. Only users installing from wheels built by the cryptography project (i.e., those distributed on PyPI) need to update their cryptography versions.

CVE-2023-0286 Affected Cryptography Versions

3 component(s)
Fixed Versions:
39.0.1111.25.0300.0.12
Product / Package Ecosystem Affected Versions Fixed Version
cryptography
PyPI
≥ 0.8.1
< 39.0.1
39.0.1
openssl-src
crates.io
< 111.25.0
111.25.0
openssl-src
crates.io
≥ 300.0.0
< 300.0.12
300.0.12

References

Frequently Asked Questions

What is CVE-2023-0286?
CVE-2023-0286 is a security vulnerability in Cryptography involving Vulnerable OpenSSL included in cryptography wheels under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion').
Which Cryptography versions are affected?
Affected versions include releases prior to 39.0.1, 111.25.0, 300.0.12 across affected packages: cryptography, openssl-src.
What version fixes CVE-2023-0286?
Upgrading to 39.0.1, 111.25.0, 300.0.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cryptography affected?
Yes, cryptography is affected in releases prior to 39.0.1. Upgrade your dependency to 39.0.1 or later.
Is openssl-src affected?
Yes, openssl-src is affected in releases prior to 111.25.0, 300.0.12. Upgrade your dependency to 111.25.0, 300.0.12 or later.
What is the CVSS score of CVE-2023-0286?
CVE-2023-0286 has a CVSS v3.1 base score of 7.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H.
What CWE is associated with CVE-2023-0286?
CVE-2023-0286 is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') (The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.).
How can I check PyPI dependencies for CVE-2023-0286?
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-x4qr-2fvf-3mr5",
  "modified" : "2025-11-04T22:08:44Z",
  "published" : "2023-02-08T22:17:06Z",
  "aliases" : [ "CVE-2023-0286" ],
  "summary" : "Vulnerable OpenSSL included in cryptography wheels",
  "details" : "pyca/cryptography's wheels include a statically linked copy of OpenSSL. The versions of OpenSSL included in cryptography 0.8.1-39.0.0  are vulnerable to a security issue. More details about the vulnerabilities themselves can be found in https://www.openssl.org/news/secadv/20221213.txt and https://www.openssl.org/news/secadv/20230207.txt.\n\nIf you are building cryptography source (\"sdist\") then you are responsible for upgrading your copy of OpenSSL. Only users installing from wheels built by the cryptography project (i.e., those distributed on PyPI) need to update their cryptography versions.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "cryptography"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.8.1"
      }, {
        "fixed" : "39.0.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "openssl-src"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "111.25.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "openssl-src"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "300.0.0"
      }, {
        "fixed" : "300.0.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/security/advisories/GHSA-x4qr-2fvf-3mr5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-0286"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/cve-2023-0286"
  }, {
    "type" : "WEB",
    "url" : "https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.6.2-relnotes.txt"
  }, {
    "type" : "WEB",
    "url" : "https://ftp.openbsd.org/pub/OpenBSD/patches/7.2/common/018_x509.patch.sig"
  }, {
    "type" : "WEB",
    "url" : "https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=2c6c9d439b484e1ba9830d8454a34fa4f80fdfe9"
  }, {
    "type" : "WEB",
    "url" : "https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=2f7530077e0ef79d98718138716bc51ca0cad658"
  }, {
    "type" : "WEB",
    "url" : "https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=fd2af07dc083a350c959147097003a14a5e8ac4d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyca/cryptography"
  }, {
    "type" : "WEB",
    "url" : "https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2023-0003"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0006.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202402-08"
  }, {
    "type" : "WEB",
    "url" : "https://www.openssl.org/news/secadv/20230207.txt"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-843" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-08T22:17:06Z",
    "nvd_published_at" : "2023-02-08T20:15:00Z"
  }
}