CVE-2024-26130cryptography NULL pointer deference with pkcs12.serialize_key_and_certificates when…
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.
What to do
Fixed builds are available from AlmaLinux, Debian, PyPI, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | python-cryptography | Fixed | 41.0.7-4ubuntu0.1 | UBUNTU-CVE-2024-26130 |
| Ubuntu 22.04 | python-cryptography | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | python-cryptography | Fix pending | ||
| Debian 14 | python-cryptography | Fixed | 42.0.5-1 | DEBIAN-CVE-2024-26130 |
| Debian 13 | python-cryptography | Fixed | 42.0.5-1 | DEBIAN-CVE-2024-26130 |
| Debian 12 | python-cryptography | Fixed | 38.0.4-3+deb12u1 | DEBIAN-CVE-2024-26130 |
| Red Hat Enterprise Linux 9 | python-cryptography | Not affected | ||
| Red Hat Enterprise Linux 9 | python3-cryptography | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.11-cryptography | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.12-cryptography | Fixed | 0:41.0.7-2.el9_6.1 | RHSA-2025:15608 |
| Red Hat Enterprise Linux 8 | python-cryptography | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-cryptography | Not affected | ||
| Red Hat Enterprise Linux 7 | python-cryptography | Not affected | ||
| Red Hat Enterprise Linux 7 | python2-cryptography | Not affected | ||
| AlmaLinux 9 | python3.12-cryptography | Fixed | 41.0.7-2.el9_6.1 | ALSA-2025:15608 |
| Rocky Linux 9 | python3.12-cryptography | Fixed | 0:41.0.7-2.el9_6.1 | RLSA-2025:15608 |
| PyPI library | cryptography | Fixed | 42.0.4 | PYSEC-2024-225 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- pyca cryptography: affected: >= 38.0.0, < 42.0.4
References
- https://github.com/pyca/cryptography/security/advisories/GHSA-6vqw-3v5j-54x4
- https://github.com/pyca/cryptography/pull/10423
- https://github.com/pyca/cryptography/commit/97d231672763cdb5959a3b191e692a362f1b9e55
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.