CVEfocus › CVE database › CVE-2024-26130

CVE-2024-26130cryptography NULL pointer deference with pkcs12.serialize_key_and_certificates when…

CVSS 7.5 HighEPSS 1.7% (higher than 77% of CVEs)Published 2024-02-21Updated 2024-08-14Assigner: GitHub_M

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.

CWE-476

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

8Fixed
1Fix pending
8Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04python-cryptographyFixed41.0.7-4ubuntu0.1UBUNTU-CVE-2024-26130
Ubuntu 22.04python-cryptographyNot affected
vulnerable_code_not_present
Ubuntu 16.04python-cryptographyFix pending
Debian 14python-cryptographyFixed42.0.5-1DEBIAN-CVE-2024-26130
Debian 13python-cryptographyFixed42.0.5-1DEBIAN-CVE-2024-26130
Debian 12python-cryptographyFixed38.0.4-3+deb12u1DEBIAN-CVE-2024-26130
Red Hat Enterprise Linux 9python-cryptographyNot affected
Red Hat Enterprise Linux 9python3-cryptographyNot affected
Red Hat Enterprise Linux 9python3.11-cryptographyNot affected
Red Hat Enterprise Linux 9python3.12-cryptographyFixed0:41.0.7-2.el9_6.1RHSA-2025:15608
Red Hat Enterprise Linux 8python-cryptographyNot affected
Red Hat Enterprise Linux 8python3-cryptographyNot affected
Red Hat Enterprise Linux 7python-cryptographyNot affected
Red Hat Enterprise Linux 7python2-cryptographyNot affected
AlmaLinux 9python3.12-cryptographyFixed41.0.7-2.el9_6.1ALSA-2025:15608
Rocky Linux 9python3.12-cryptographyFixed0:41.0.7-2.el9_6.1RLSA-2025:15608
PyPI librarycryptographyFixed42.0.4PYSEC-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.

References

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.