Skip to content

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

HighCVSS 7.5 EPSS 0.83%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: yes · technical impact: partial
Technology
UbuntuDebian

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.

Upgrade path

8 packages: 7 fixed.

PackageAffectedFixed inStatus
cryptography project cryptography >= 38.0.0, < 42.04 42.04 Fixed
cryptography.io cryptography >= 38.0.0, < 42.0.4 42.0.4 Fixed
debian/python-cryptography(Debian 12) < 38.0.4-3+deb12u1; = 38.0.4-3 38.0.4-3+deb12u1 Fixed
debian/python-cryptography(Debian 13) < 42.0.5-1 42.0.5-1 Fixed
debian/python-cryptography(Debian 14) < 42.0.5-1 42.0.5-1 Fixed
pypi cryptography(PyPI) = 0.1; = 0.2; = 0.3; = 0.4 +60 more 42.0.4 Fixed
ubuntu/python-cryptography(Ubuntu 24.04) < 41.0.7-4ubuntu0.1; = 38.0.4-4; = 38.0.4-4ubuntu1; = 41.0.7-3 +2 more 41.0.7-4ubuntu0.1 Fixed
pyca cryptography = >= 38.0.0, < 42.0.4 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
pypi cryptography(PyPI) >= 38.0.0, < 42.0.4 42.0.4
pypi cryptography(PyPI) = 38.0.0 No fix listed
pypi cryptography(PyPI) = 38.0.1 No fix listed
pypi cryptography(PyPI) = 38.0.2 No fix listed
pypi cryptography(PyPI) = 38.0.3 No fix listed
pypi cryptography(PyPI) = 38.0.4 No fix listed
pypi cryptography(PyPI) = 39.0.0 No fix listed
pypi cryptography(PyPI) = 39.0.1 No fix listed
pypi cryptography(PyPI) = 39.0.2 No fix listed
pypi cryptography(PyPI) = 40.0.0 No fix listed
pypi cryptography(PyPI) = 40.0.1 No fix listed
pypi cryptography(PyPI) = 40.0.2 No fix listed
pypi cryptography(PyPI) = 41.0.0 No fix listed
pypi cryptography(PyPI) = 41.0.1 No fix listed
pypi cryptography(PyPI) = 41.0.2 No fix listed
pypi cryptography(PyPI) = 41.0.3 No fix listed
pypi cryptography(PyPI) = 41.0.4 No fix listed
pypi cryptography(PyPI) = 41.0.5 No fix listed
pypi cryptography(PyPI) = 41.0.6 No fix listed
pypi cryptography(PyPI) = 41.0.7 No fix listed
pypi cryptography(PyPI) = 42.0.0 No fix listed
pypi cryptography(PyPI) = 42.0.1 No fix listed
pypi cryptography(PyPI) = 42.0.2 No fix listed
pypi cryptography(PyPI) = 42.0.3 No fix listed
pypi cryptography(PyPI) = 37.0.0 No fix listed
Show 52 more
ProductAffected versionsFixed in
pypi cryptography(PyPI) = 36.0.0 No fix listed
pypi cryptography(PyPI) = 35.0.0 No fix listed
pypi cryptography(PyPI) = 3.4 No fix listed
pypi cryptography(PyPI) = 3.3 No fix listed
pypi cryptography(PyPI) = 3.2 No fix listed
pypi cryptography(PyPI) = 3.1 No fix listed
pypi cryptography(PyPI) = 3.0 No fix listed
pypi cryptography(PyPI) = 2.9 No fix listed
pypi cryptography(PyPI) = 2.8 No fix listed
pypi cryptography(PyPI) = 2.7 No fix listed
pypi cryptography(PyPI) = 2.6.1 No fix listed
pypi cryptography(PyPI) = 2.6 No fix listed
pypi cryptography(PyPI) = 2.5 No fix listed
pypi cryptography(PyPI) = 2.4.1 No fix listed
pypi cryptography(PyPI) = 2.4 No fix listed
pypi cryptography(PyPI) = 2.3 No fix listed
pypi cryptography(PyPI) = 2.2 No fix listed
pypi cryptography(PyPI) = 2.1 No fix listed
pypi cryptography(PyPI) = 2.0 No fix listed
pypi cryptography(PyPI) = 1.9 No fix listed
pypi cryptography(PyPI) = 1.8 No fix listed
pypi cryptography(PyPI) = 1.7 No fix listed
pypi cryptography(PyPI) = 1.6 No fix listed
pypi cryptography(PyPI) = 1.5 No fix listed
pypi cryptography(PyPI) = 1.4 No fix listed
pypi cryptography(PyPI) = 1.3 No fix listed
pypi cryptography(PyPI) = 1.2 No fix listed
pypi cryptography(PyPI) = 1.1 No fix listed
pypi cryptography(PyPI) = 1.0 No fix listed
pypi cryptography(PyPI) = 0.9 No fix listed
pypi cryptography(PyPI) = 0.8 No fix listed
pypi cryptography(PyPI) = 0.7 No fix listed
pypi cryptography(PyPI) = 0.6 No fix listed
pypi cryptography(PyPI) = 0.5.1 No fix listed
pypi cryptography(PyPI) = 0.5 No fix listed
pypi cryptography(PyPI) = 0.4 No fix listed
pypi cryptography(PyPI) = 0.3 No fix listed
pypi cryptography(PyPI) = 0.2 No fix listed
pypi cryptography(PyPI) = 0.1 No fix listed
debian/python-cryptography(Debian:12) < 38.0.4-3+deb12u1 38.0.4-3+deb12u1
debian/python-cryptography(Debian:12) = 38.0.4-3 No fix listed
debian/python-cryptography(Debian:13) < 42.0.5-1 42.0.5-1
debian/python-cryptography(Debian:14) < 42.0.5-1 42.0.5-1
pyca cryptography = >= 38.0.0, < 42.0.4 No fix listed
cryptography project cryptography >= 38.0.0, < 42.04 42.04
ubuntu/python-cryptography(Ubuntu:24.04) < 41.0.7-4ubuntu0.1 41.0.7-4ubuntu0.1
cryptography.io cryptography >= 38.0.0, < 42.0.4 42.0.4
ubuntu/python-cryptography(Ubuntu:24.04) = 38.0.4-4 No fix listed
ubuntu/python-cryptography(Ubuntu:24.04) = 38.0.4-4ubuntu1 No fix listed
ubuntu/python-cryptography(Ubuntu:24.04) = 41.0.7-3 No fix listed
ubuntu/python-cryptography(Ubuntu:24.04) = 41.0.7-4build2 No fix listed
ubuntu/python-cryptography(Ubuntu:24.04) = 41.0.7-4build3 No fix listed

References