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

HIGH
7.5
CVSS Score
Published: February 21, 2024 at 04:28 PM UTC
Updated: June 17, 2026 at 07:17 AM UTC
3 products affected across 3 vendorsCryptographyCryptographyCryptography

Using cryptography by pyca?

Get instant alerts when new vulnerabilities affect cryptography - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.5
Exploit prediction
EPSS 0.8%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

38.0.0 ≤ v < 42.0.4
Affected range stops below 42.0.4, so it looks safe — our inference, not a vendor statement
38.0.0 ≤ v < 42.0438.0.0
Affected range stops below 42.04, so it looks safe — our inference, not a vendor statement
v < 42.0.4
Affected range stops below 42.0.4, so it looks safe — our inference, not a vendor statement

SSVC — Action Prioritization

SSVCNo known exploitAutomatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.5HIGHGitHub_M
Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-476

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card