p PatchFirst

CVE-2024-26130

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

This page contains facts from public vulnerability sources. Check the original advisory before updating.

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.

CVSS 7.5 · High · EPSS 0.8% · Fix available

Published
Updated

Stack: system · python

Affected products and versions

  • cryptography

    Versions
    • >= 38.0.0, < 42.0.4: Affected

    No fix published

  • python-cryptography Debian:12

    Versions
    • 38.0.4-3
    Affected ranges
    • ECOSYSTEM: < 38.0.4-3+deb12u1

    Update to 38.0.4-3+deb12u1

  • python-cryptography Debian:13

    Affected ranges
    • ECOSYSTEM: < 42.0.5-1

    Update to 42.0.5-1

  • python-cryptography Debian:14

    Affected ranges
    • ECOSYSTEM: < 42.0.5-1

    Update to 42.0.5-1

  • cryptography PyPI

    Versions
    • 38.0.0
    • 38.0.1
    • 38.0.2
    • 38.0.3
    • 38.0.4
    • 39.0.0
    • 39.0.1
    • 39.0.2
    • 40.0.0
    • 40.0.1
    • 40.0.2
    • 41.0.0
    • 41.0.1
    • 41.0.2
    • 41.0.3
    • 41.0.4
    • 41.0.5
    • 41.0.6
    • 41.0.7
    • 42.0.0
    • 42.0.1
    • 42.0.2
    • 42.0.3
    Affected ranges
    • ECOSYSTEM: ≥ 38.0.0, < 42.0.4

    Update to 42.0.4

  • cryptography PyPI

    Versions
    • 38.0.0
    • 38.0.1
    • 38.0.2
    • 38.0.3
    • 38.0.4
    • 39.0.0
    • 39.0.1
    • 39.0.2
    • 40.0.0
    • 40.0.1
    • 40.0.2
    • 41.0.0
    • 41.0.1
    • 41.0.2
    • 41.0.3
    • 41.0.4
    • 41.0.5
    • 41.0.6
    • 41.0.7
    • 42.0.0
    • 42.0.1
    • 42.0.2
    • 42.0.3
    • 37.0.0
    • 36.0.0
    • 35.0.0
    • 3.4
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.9
    • 2.8
    • 2.7
    • 2.6.1
    • 2.6
    • 2.5
    • 2.4.1
    • 2.4
    • 2.3
    • 2.2
    • 2.1
    • 2.0
    • 1.9
    • 1.8
    • 1.7
    • 1.6
    • 1.5
    • 1.4
    • 1.3
    • 1.2
    • 1.1
    • 1.0
    • 0.9
    • 0.8
    • 0.7
    • 0.6
    • 0.5.1
    • 0.5
    • 0.4
    • 0.3
    • 0.2
    • 0.1
    Affected ranges
    • GIT: < 97d231672763cdb5959a3b191e692a362f1b9e55
    • ECOSYSTEM: ≥ 38.0.0, < 42.0.4

    Update to 42.0.4

  • python-cryptography Ubuntu:24.04:LTS

    Versions
    • 38.0.4-4
    • 38.0.4-4ubuntu1
    • 41.0.7-3
    • 41.0.7-4build2
    • 41.0.7-4build3
    Affected ranges
    • ECOSYSTEM: < 41.0.7-4ubuntu0.1

    Update to 41.0.7-4ubuntu0.1

Original sources

Check your server →