cryptography CVEs 2023–2024 — PyPI Security Fix Guide

Updated March 2026 · PackageFix · Safe version: 42.0.8+

The Python cryptography package wraps OpenSSL via CFFI. CVEs here often reflect upstream OpenSSL vulnerabilities. This page covers every CVE from 2023–2024 and the exact version that fixes each one.

cryptography CVEs 2023–2024

CVEYearSeverityDescriptionFix
CVE-2023-490832023HIGHNULL pointer dereference in PKCS12 parsingFixed 41.0.6
CVE-2024-07272024MEDIUMDoS via NULL fields in X.509 certificateFixed 42.0.2
CVE-2024-261302024HIGHNULL pointer dereference in PKCS12 serializationFixed 42.0.4
CVE-2024-25112024MEDIUMMemory leak via SSL session cacheFixed 42.0.5
CVE-2024-47412024HIGHUse-after-free in SSL_free_buffersFixed 42.0.7
CVE-2024-55352024HIGHBuffer over-read in SSL_select_next_protoFixed 42.0.8

Current safe version

Fix
# Before
cryptography==41.0.0

# After
cryptography==42.0.8

# Update
pip install cryptography==42.0.8
# Or update requirements.txt and run:
pip install -r requirements.txt

Why cryptography has frequent CVEs

The cryptography package wraps OpenSSL's C library via CFFI. When OpenSSL releases a security fix, the cryptography package typically releases a new version within days. Most CVEs in this package originate in OpenSSL's C code — NULL pointer dereferences, buffer overreads, memory leaks — rather than in the Python wrapper itself.

Keep cryptography updated as frequently as you update other dependencies. The safe version changes more often than most Python packages because of this upstream relationship.

Paste your manifest — get the exact safe version instantly.

Scan with PackageFix →

Free · No signup · No CLI

Common questions

Does updating cryptography break my code?
cryptography follows semver. Minor version updates (41.x to 42.x) may have API changes but the core encryption API is stable. Check the changelog at cryptography.io/en/latest/changelog/ before upgrading major versions.
Is cryptography the same as PyCryptodome?
No. cryptography (by PyCA) wraps OpenSSL via CFFI. PyCryptodome is a standalone implementation. They have different APIs and different CVE histories. Most modern Python projects use cryptography.
How do I check my current cryptography version?
Run: pip show cryptography. Or paste your requirements.txt into PackageFix to get the exact CVE exposure for your installed version.

Related