CVE-2024-26130
python-cryptography: NULL pointer dereference with pkcs12.serialize_key_and_certificates when called with a non-matching certificate and private key and an hmac_hash override
Overview
Description
cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. Starting in version 38.0.0 and prior to version 42.0.4, if pkcs12.serialize_key_and_certificates is called with both a certificate whose public key did not match the provided private key and an encryption_algorithm with hmac_hash set (via PrivateFormat.PKCS12.encryption_builder().hmac_hash(...), then a NULL pointer dereference would occur, crashing the Python process. This has been resolved in version 42.0.4, the first version in which a ValueError is properly raised.
Source: OX vulnerability database
Severity
7.5 · HIGH
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness: CWE-476
Affected packages · 1
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| PyPI | cryptography | >=38.0.0, <42.0.4 | 42.0.4 |
Open a package to see all its vulnerabilities.
Operating systems · 34 fixes
Oracle Linux 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 8 | python3-12-cryptography | 41.0.7-1.0.1.el8 |
| 9 | python3-12-cryptography | 41.0.7-2.el9_6.1 |
Photon OS 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 4.0 | python3-cryptography | 41.0.7-2.ph4 |
| 5.0 | python3-cryptography | 41.0.7-3.ph5 |
Red Hat 2 releases · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 7 | python-cryptography +1 | affected | — |
| 9 | python3-12-cryptography | 0:41.0.7-2.el9_6.1 | RHSA-2025:15608 |
SUSE Linux Enterprise 2 releases · 1 package
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.5 | python311-cryptography | 41.0.3-150400.16.15.1 | SUSE-SU-2024:0763-1 |
| 15.6 | python311-cryptography | 41.0.3-150600.23.3.1 | SUSE-SU-2024:2138-1 |
alma 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 9 | python3-12-cryptography | 41.0.7-2.el9_6.1 |
chainguard 1 release · 8 packages
| Release | Package | Fixed in |
|---|---|---|
| py3-cassandra-medusa | 0.19.1-r1 | |
| request-1276 | 0.23.0-r30 | |
| ggshield | 1.25.0-r0 | |
| mitmproxy | 12.2.1-r0 | |
| kubeflow-pipelines | 2.0.5-r3 | |
| airflow | 2.10.5-r44 |
2 more rows
debian 3 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 12 | python-cryptography | 38.0.4-3+deb12u1 |
| 13 | python-cryptography | 42.0.5-1 |
| 14 | python-cryptography | 42.0.5-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| python-cryptography | 38.0.4-3+deb12u1 |
openSUSE 1 release · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Tumbleweed | python310-cryptography +3 | 42.0.4-1.1 | openSUSE-SU-2024:13710-1 |
| Tumbleweed | python313-cryptography +1 | 50.0.0-1.1 | openSUSE-SU-2026:11468-1 |
rocky 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 9 | python3-12-cryptography | 41.0.7-2.el9_6.1 |
root.io debian 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 12 | rootio-python-cryptography | 38.0.4-3+deb12u1 |
seal Red Hat 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 7 | python-jinja2 +1 | 2.7.2-4.el7+sp999 |
ubuntu 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 24.04 | python-cryptography | 41.0.7-4ubuntu0.1 |
wolfi 1 release · 7 packages
| Release | Package | Fixed in |
|---|---|---|
| py3-cassandra-medusa | 0.19.1-r1 | |
| ggshield | 1.25.0-r0 | |
| mitmproxy | 12.2.1-r0 | |
| kubeflow-pipelines | 2.0.5-r3 | |
| airflow | 2.10.5-r44 | |
| az | 2.58.0-r0 |
1 more row
References
- access.redhat.com https://access.redhat.com/errata/RHSA-2025:15608
- access.redhat.com https://access.redhat.com/security/cve/CVE-2024-26130
- bugzilla.redhat.com https://bugzilla.redhat.com/2269617
- bugzilla.redhat.com https://bugzilla.redhat.com/show_bug.cgi?id=2269617
- creativecommons.org https://creativecommons.org/licenses/by/4.0/
- cve.mitre.org https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-26130
- errata.almalinux.org https://errata.almalinux.org/9/ALSA-2025-15608.html
- errata.rockylinux.org https://errata.rockylinux.org/RLSA-2025:15608
- github.com https://github.com/pyca/cryptography
- github.com https://github.com/pyca/cryptography/commit/97d231672763cdb5959a3b191e692a362f1b9e55
Show all 19 references
- github.com https://github.com/pyca/cryptography/pull/10423
- github.com https://github.com/pyca/cryptography/security/advisories/GHSA-6vqw-3v5j-54x4
- github.com https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2024-225.yaml
- linux.oracle.com https://linux.oracle.com/cve/CVE-2024-26130.html
- linux.oracle.com https://linux.oracle.com/errata/ELSA-2025-20364.html
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2024-26130
- ubuntu.com https://ubuntu.com/security/notices/USN-6673-1
- ubuntu.com https://ubuntu.com/security/notices/USN-6673-3
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2024-26130
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.