GHSA-9v9h-cgj8-h64p CVE-2024-0727 PYSEC-2026-1285
Null pointer dereference in PKCS12 parsing
- Severity
- 5.5 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 3.19%
- Chance of exploitation in the next 30 days. Higher than 88.09% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-476 NULL Pointer Dereference
- Fix
42.0.2- Upgrade cryptography to this version or later
Description
Issue summary: Processing a maliciously formatted PKCS12 file may lead OpenSSL to crash leading to a potential Denial of Service attack
Impact summary: Applications loading files in the PKCS12 format from untrusted sources might terminate abruptly.
A file in PKCS12 format can contain certificates and keys and may come from an untrusted source. The PKCS12 specification allows certain fields to be NULL, but OpenSSL does not correctly check for this case. This can lead to a NULL pointer dereference that results in OpenSSL crashing. If an application processes PKCS12 files from an untrusted source using the OpenSSL APIs then that application will be vulnerable to this issue.
OpenSSL APIs that are vulnerable to this are: PKCS12_parse(), PKCS12_unpack_p7data(), PKCS12_unpack_p7encdata(), PKCS12_unpack_authsafes() and PKCS12_newpass().
We have also fixed a similar issue in SMIME_write_PKCS7(). However since this function is related to writing data we do not consider it security significant.
The FIPS modules in 3.2, 3.1 and 3.0 are not affected by this issue.
Affected versions
PyPI
| Package | Vulnerable | Fixed in |
|---|---|---|
| cryptography | < 42.0.2 |
42.0.2 |
| cryptography | < 42.0.2 |
42.0.2 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
cryptography PyPI → 42.0.2
- pip
pip install --upgrade "cryptography>=42.0.2"- poetry
poetry add "cryptography>=42.0.2"- uv
uv add "cryptography>=42.0.2"
Severity breakdown
CVSS 3.1 5.5
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Weakness
CWE-476: NULL Pointer Dereference
The product dereferences a pointer that it expects to be valid but is NULL.
How to prevent it
- Implementation: For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].
- Requirements: Select a programming language that is not susceptible to these issues.
- Implementation: Check the results of all functions that return a value and verify that the value is non-null before acting upon it.
- Architecture and Design: Identify all variables and data stores that receive information from external sources, and apply input validation to make sure that they are only initialized to expected values.
- Implementation: Explicitly initialize all variables and other data stores, either during declaration or just before the first usage.
References
Advisories
Fixes and patches
- github.com/openssl/openssl/commit/09df4395b5071217b76dc7d3d2e630eb8c5a79c2
- github.com/openssl/openssl/commit/775acfdbd0c6af9ac855f34969cdab0c0c90844a
- github.com/openssl/openssl/commit/d135eeab8a5dbf72b3da5240bab9ddb7678dbd2c
- github.openssl.org/openssl/extended-releases/commit/03b3941d60c4bce58fab69a0c22377ab439…
- github.openssl.org/openssl/extended-releases/commit/aebaa5883e31122b404e450732dc833dc9d…
- github.com/github/advisory-database/pull/3472
- github.com/openssl/openssl/pull/23362
- github.com/alexcrichton/openssl-src-rs/commit/add20f73b6b42be7451af2e1044d4e0e7…
- github.com/pyca/cryptography/commit/3519591d255d4506fbcd0d04037d45271903c64d
Packages
Other links
- openssl.org/news/secadv/20240125.txt
- security.netapp.com/advisory/ntap-20240208-0006
- openwall.com/lists/oss-security/2024/03/11/1
- lists.debian.org/debian-lts-announce/2024/10/msg00033.html
- lists.debian.org/debian-lts-announce/2024/11/msg00000.html
- cert-portal.siemens.com/productcert/html/ssa-915275.html
- cert-portal.siemens.com/productcert/html/ssa-769027.html
- cert-portal.siemens.com/productcert/html/ssa-331112.html
- cert-portal.siemens.com/productcert/html/ssa-277137.html
- cert-portal.siemens.com/productcert/html/ssa-265688.html
- security.netapp.com/advisory/ntap-20240208-0006
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-m2h6-j472-rp4c python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees | Medium | Also affects cryptography |
| GHSA-jwv3-5hgf-82ww python-cryptography: Duplicate self-signed intermediates can cause exponential path-building | High | Also affects cryptography |
| GHSA-g6cj-pr64-35w5 cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing | High | Also affects cryptography |
| GHSA-537c-gmf6-5ccf Vulnerable OpenSSL included in cryptography wheels | High | Also affects cryptography |
| GHSA-p423-j2cm-9vmq Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs | Medium | Also affects cryptography |
| GHSA-m959-cc7f-wv43 cryptography has incomplete DNS name constraint enforcement on peer names | Low | Also affects cryptography |
| GHSA-r6ph-v2qm-q3c2 cryptography Vulnerable to a Subgroup Attack Due to Missing Subgroup Validation for SECT Curves | High | Also affects cryptography |
| GHSA-79v4-65xg-pq4g Vulnerable OpenSSL included in cryptography wheels | Medium | Also affects cryptography |
Credits: m3t3kh4n
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor