CVE-2024-0727: Cryptography Null Pointer Dereference Vulnerability
MODERATECVE-2024-0727 is a MODERATE (CVSS 5.5) null pointer dereference vulnerability (CWE-476: NULL Pointer Dereference) affecting Cryptography libraries in the PyPI ecosystem. The issue involves null pointer dereference in pkcs12 parsing. Remediation is available by upgrading affected packages to version 42.0.2.
CVE-2024-0727 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2024-0727
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.
pip install cryptography>=42.0.2
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-2024-0727, 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.2), 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-476: NULL Pointer Dereference, where the product dereferences a pointer that it expects to be valid but is null. 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
CVE-2024-0727 Affected Cryptography Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
cryptography
|
PyPI |
< 42.0.2
|
42.0.2
|
References
Frequently Asked Questions
What is CVE-2024-0727?
Which Cryptography versions are affected?
What version fixes CVE-2024-0727?
Is cryptography affected?
What is the CVSS score of CVE-2024-0727?
What CWE is associated with CVE-2024-0727?
How can I check PyPI dependencies for CVE-2024-0727?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9v9h-cgj8-h64p",
"modified" : "2026-05-13T15:24:21Z",
"published" : "2024-01-26T09:30:23Z",
"aliases" : [ "CVE-2024-0727" ],
"summary" : "Null pointer dereference in PKCS12 parsing",
"details" : "Issue summary: Processing a maliciously formatted PKCS12 file may lead OpenSSL\nto crash leading to a potential Denial of Service attack\n\nImpact summary: Applications loading files in the PKCS12 format from untrusted\nsources might terminate abruptly.\n\nA file in PKCS12 format can contain certificates and keys and may come from an\nuntrusted source. The PKCS12 specification allows certain fields to be NULL, but\nOpenSSL does not correctly check for this case. This can lead to a NULL pointer\ndereference that results in OpenSSL crashing. If an application processes PKCS12\nfiles from an untrusted source using the OpenSSL APIs then that application will\nbe vulnerable to this issue.\n\nOpenSSL APIs that are vulnerable to this are: PKCS12_parse(),\nPKCS12_unpack_p7data(), PKCS12_unpack_p7encdata(), PKCS12_unpack_authsafes()\nand PKCS12_newpass().\n\nWe have also fixed a similar issue in SMIME_write_PKCS7(). However since this\nfunction is related to writing data we do not consider it security significant.\n\nThe FIPS modules in 3.2, 3.1 and 3.0 are not affected by this issue.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "cryptography"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "42.0.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-0727"
}, {
"type" : "WEB",
"url" : "https://github.com/github/advisory-database/pull/3472"
}, {
"type" : "WEB",
"url" : "https://github.com/openssl/openssl/pull/23362"
}, {
"type" : "WEB",
"url" : "https://github.com/alexcrichton/openssl-src-rs/commit/add20f73b6b42be7451af2e1044d4e0e778992b2"
}, {
"type" : "WEB",
"url" : "https://github.com/openssl/openssl/commit/09df4395b5071217b76dc7d3d2e630eb8c5a79c2"
}, {
"type" : "WEB",
"url" : "https://github.com/openssl/openssl/commit/775acfdbd0c6af9ac855f34969cdab0c0c90844a"
}, {
"type" : "WEB",
"url" : "https://github.com/openssl/openssl/commit/d135eeab8a5dbf72b3da5240bab9ddb7678dbd2c"
}, {
"type" : "WEB",
"url" : "https://github.com/pyca/cryptography/commit/3519591d255d4506fbcd0d04037d45271903c64d"
}, {
"type" : "WEB",
"url" : "https://www.openssl.org/news/secadv/20240125.txt"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20240208-0006"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2024/11/msg00000.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2024/10/msg00033.html"
}, {
"type" : "WEB",
"url" : "https://github.openssl.org/openssl/extended-releases/commit/aebaa5883e31122b404e450732dc833dc9dee539"
}, {
"type" : "WEB",
"url" : "https://github.openssl.org/openssl/extended-releases/commit/03b3941d60c4bce58fab69a0c22377ab439bc0e8"
}, {
"type" : "WEB",
"url" : "https://cert-portal.siemens.com/productcert/html/ssa-915275.html"
}, {
"type" : "WEB",
"url" : "https://cert-portal.siemens.com/productcert/html/ssa-769027.html"
}, {
"type" : "WEB",
"url" : "https://cert-portal.siemens.com/productcert/html/ssa-331112.html"
}, {
"type" : "WEB",
"url" : "https://cert-portal.siemens.com/productcert/html/ssa-277137.html"
}, {
"type" : "WEB",
"url" : "https://cert-portal.siemens.com/productcert/html/ssa-265688.html"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2024/03/11/1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-476" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-02-16T20:48:36Z",
"nvd_published_at" : "2024-01-26T09:15:07Z"
}
}