CVE-2024-26130

cryptography NULL pointer deference with pkcs12.serialize_key_and_certificates when called with a non-matching certificate and private key and an hmac_hash override

Published Feb 21, 2024 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2024-0031 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.
Github GHSA Github GHSA GHSA-6vqw-3v5j-54x4 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
Ubuntu USN Ubuntu USN USN-6673-1 python-cryptography vulnerabilities
Ubuntu USN Ubuntu USN USN-6673-3 python-cryptography vulnerability
History
Type Values Removed Values Added
Metrics epss

{'score': 0.00257}

epss

{'score': 0.00264}

Type Values Removed Values Added
First Time appeared Redhat rhui
CPEs cpe:/a:redhat:rhui:4::el8
Vendors & Products Redhat rhui
Type Values Removed Values Added
First Time appeared Cryptography.io
Cryptography.io cryptography
CPEs cpe:2.3:a:cryptography.io:cryptography:*:*:*:*:*:python:*:*
Vendors & Products Cryptography.io
Cryptography.io cryptography
Type Values Removed Values Added
First Time appeared Redhat satellite
Redhat satellite Capsule
CPEs cpe:/a:redhat:satellite:6.15::el8
cpe:/a:redhat:satellite_capsule:6.15::el8
Vendors & Products Redhat satellite
Redhat satellite Capsule
Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 14, 2024, 8:01 PM
Reserved
Feb 14, 2024, 5:40 PM
Status
Analyzed
Published
Feb 21, 2024, 5:15 PM
Modified
Jun 17, 2026, 7:17 AM
Severity
Important
Public date
Feb 21, 2024, 12:00 AM