cve.bz

CVE-2024-26130 cryptography.io cryptography: NULL Pointer Dereference

7.5 highEPSS 0.8%Fix available

High (7.5) in cryptography.io cryptography. EPSS 0.8% estimated probability of exploitation activity in the next 30 days. Fixed in cryptography 42.0.4.

On this page
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.

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
0.8% (unchanged from 0.8% a week ago; 0.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 58th percentile. Scored 2026-11-21. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: partial, assessed 2024-08-14. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-476 NULL Pointer Dereference
OWASP Top 10
A10:2025 Mishandling of Exceptional Conditions
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-26130 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-26130?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-26130?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-26130 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
cryptography.io:cryptographyfrom 38.0.0 before 42.0.4

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-6vqw-3v5j-54x4PyPIcryptography>=38.0.0 <42.0.442.0.4
PYSEC-2024-225PyPIcryptography>=38.0.0 <42.0.442.0.4

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12python-cryptography38.0.4-3+deb12u1DEBIAN-CVE-2024-26130
Debian13, 14python-cryptography42.0.5-1DEBIAN-CVE-2024-26130
Ubuntu20.04:LTSpython-cryptography2.8-3ubuntu0.3USN-6673-1
Ubuntu22.04:LTSpython-cryptography3.4.8-1ubuntu2.2USN-6673-1
Ubuntu24.04:LTSpython-cryptography41.0.7-4ubuntu0.1UBUNTU-CVE-2024-26130 USN-6673-3
UbuntuPro:18.04:LTSpython-cryptography2.1.4-1ubuntu1.4+esm1USN-6673-1
Red Hatansible_automation_platform:2.4::el8automation-controller-venv-tower0:4.5.7-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8automation-hub, python39-galaxy-ng, python3x-galaxy-ng0:4.9.2-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-aiohttp, python3x-aiohttp, python39-aiohttp-debuginfo and 1 more0:3.9.5-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-gunicorn, python3x-gunicorn0:22.0.0-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-pillow, python3x-pillow, python39-pillow-debuginfo and 1 more0:10.3.0-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-pydantic, python3x-pydantic0:1.10.15-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-social-auth-app-django, python3x-social-auth-app-django0:5.4.1-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-sqlparse, python3x-sqlparse0:0.5.0-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8python39-idna, python3x-idna0:3.7-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8python39-requests, python3x-requests0:2.32.2-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8python39-black, python3x-black0:22.8.0-2.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8python39-cryptography, python3x-cryptography, python39-cryptography-debuginfo and 1 more0:42.0.5-1.el8apRHSA-2024:3781
30 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Python 3 15 SP5python-cryptography41.0.3-150400.16.15.1SUSE-SU-2024:0763-1
SUSELinux Enterprise Module for Python 3 15 SP6python-cryptography41.0.3-150600.23.3.1SUSE-SU-2024:2138-1
openSUSELeap 15.5python-cryptography41.0.3-150400.16.15.1SUSE-SU-2024:0763-1
openSUSELeap 15.6python-cryptography41.0.3-150600.23.3.1SUSE-SU-2024:2138-1
openSUSETumbleweedpython-cryptography42.0.4-1.1openSUSE-SU-2024:13710-1
openSUSETumbleweedpython-cryptography50.0.0-1.1openSUSE-SU-2026:11468-1
AlmaLinux9python3.12-cryptography41.0.7-2.el9_6.1ALSA-2025:15608
Rocky Linux9python3.12-cryptography0:41.0.7-2.el9_6.1RLSA-2025:15608
Alpaquita23py3-cryptographyno fix listedBELL-CVE-2024-26130
Alpaquitastreampy3-cryptography42.0.5-r0BELL-CVE-2024-26130

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpaquita.

Red Hat

Red Hat rates this Important.

Red Hat's statement

The vulnerability in python-cryptography that leads to a NULL pointer dereference during the pkcs12.serialize_key_and_certificates function execution is classified as a moderate severity issue. While the vulnerability can result in a denial-of-service (DoS) by crashing the Python process, it requires specific conditions to trigger: a mismatch between the provided certificate's public key and private key, coupled with the use of an encryption algorithm with hmac_hash set.

The exploitation of this vulnerability does not directly lead to arbitrary code execution or data leakage. Instead, it causes a controlled termination of the Python process, which, although disruptive, is not as critical as other vulnerabilities that can lead to unauthorized access, data corruption, or code injection. However, it's important to note that denial-of-service conditions can still have operational impacts, disrupting services or causing system instability.

This issue does not affect Red Hat Enterprise Linux 6, 7, 8 and 9 as we dont ship the vulnerable code and package version.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2.4 for RHEL 8python3x-cryptography-0:42.0.5-1.el8apFixed 2024-06-10RHSA-2024:3781
Red Hat Ansible Automation Platform 2.4 for RHEL 9python-cryptography-0:42.0.5-1.el9apFixed 2024-06-10RHSA-2024:3781
Red Hat Enterprise Linux 9python3.12-cryptography-0:41.0.7-2.el9_6.1Fixed 2025-09-10RHSA-2025:15608
Red Hat Satellite 6.15 for RHEL 8python-cryptography-0:42.0.8-1.el8pcFixed 2024-10-10RHSA-2024:7987
Red Hat Satellite 6.15 for RHEL 8rubygem-foreman_theme_satellite-0:13.3.0-0.1.el8satFixed 2024-10-10RHSA-2024:7987
RHUI 4 for RHEL 8python-cryptography-0:42.0.8-1.el8uiFixed 2025-02-12RHSA-2025:1335
Red Hat Enterprise Linux 7python-cryptographyNot affected
Red Hat Enterprise Linux 8python39:3.9/python-cryptographyNot affected
Red Hat Enterprise Linux 8python-cryptographyNot affected
Red Hat Enterprise Linux 9python3.11-cryptographyNot affected
Red Hat Enterprise Linux 9python-cryptographyNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-26130.

References

Check your stackJSON