cryptography is a widely used PyPI package. As of 2026-05-24, there are 30 known vulnerabilities in the OSV database. The latest stable version is 48.0.0. Developers should audit their dependency trees and update to patched versions.
Package Overview
Known Vulnerabilities (30)
| ID | Severity | Score | Affected Versions | Fixed In | Description |
|---|---|---|---|---|---|
| CVE-2023-50782 | HIGH | 7.5 | 0 to 42.0.0 | 42.0.0 | Python Cryptography package vulnerable to Bleichenbacher timing oracle attack |
| CVE-2024-26130 | HIGH | 7.5 | 38.0.0 to 42.0.4 | 42.0.4 | 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 |
| CVE-2023-38325 | HIGH | 7.5 | 40.0.0 to 41.0.2 | 41.0.2 | cryptography mishandles SSH certificates |
| CVE-2018-10903 | HIGH | 7.5 | 1.9.0 to 2.3 | 2.3 | PyCA Cryptography vulnerable to GCM tag forgery |
| CVE-2020-25659 | HIGH | 7.5 | 0 to 3.2 | 3.2 | RSA decryption vulnerable to Bleichenbacher timing vulnerability |
| CVE-2016-9243 | HIGH | 7.5 | 0 to 1.5.3 | 1.5.3 | Improper input validation in cryptography |
| CVE-2026-26007 | HIGH | 7.5 | 0 to 46.0.5 | 46.0.5 | cryptography Vulnerable to a Subgroup Attack Due to Missing Subgroup Validation for SECT Curves |
| CVE-2020-36242 | HIGH | 7.5 | 3.1 to 3.3.2 | 3.3.2 | PyCA Cryptography symmetrically encrypting large values can lead to integer overflow |
| CVE-2023-0286 | HIGH | 7.5 | 0.8.1 to 39.0.1; 0 to 111.25.0; 300.0.0 to 300.0.12 | 39.0.1 | Vulnerable OpenSSL included in cryptography wheels |
| GHSA-39hc-v87j-747x | MODERATE | 5.0 | 37.0.0 to 38.0.3 | 38.0.3 | Vulnerable OpenSSL included in cryptography wheels |
| CVE-2024-0727 | MODERATE | 5.0 | 0 to 42.0.2 | 42.0.2 | Null pointer dereference in PKCS12 parsing |
| GHSA-h4gh-qq45-vh27 | MODERATE | 5.0 | 37.0.0 to 43.0.1 | 43.0.1 | pyca/cryptography has a vulnerable OpenSSL included in cryptography wheels |
| CVE-2023-49083 | MODERATE | 5.0 | 3.1 to 41.0.6 | 41.0.6 | cryptography vulnerable to NULL-dereference when loading PKCS7 certificates |
| CVE-2026-39892 | MODERATE | 5.0 | 45.0.0 to 46.0.7 | 46.0.7 | Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs |
| CVE-2023-23931 | MODERATE | 5.0 | 1.8 to 39.0.1 | 39.0.1 | Cipher.update_into can corrupt memory if passed an immutable python object as the outbuf |
| GHSA-5cpq-8wj7-hf2v | LOW | 2.5 | 0.5 to 41.0.0 | 41.0.0 | Vulnerable OpenSSL included in cryptography wheels |
| CVE-2024-12797 | LOW | 2.5 | 42.0.0 to 44.0.1 | 44.0.1 | Vulnerable OpenSSL included in cryptography wheels |
| GHSA-jm77-qphf-c4w8 | LOW | 2.5 | 0.8 to 41.0.3 | 41.0.3 | pyca/cryptography's wheels include vulnerable OpenSSL |
| CVE-2026-34073 | LOW | 2.5 | 0 to 46.0.6 | 46.0.6 | cryptography has incomplete DNS name constraint enforcement on peer names |
| GHSA-v8gr-m533-ghj9 | LOW | 2.5 | 2.5 to 41.0.4 | 41.0.4 | Vulnerable OpenSSL included in cryptography wheels |
| CVE-2016-9243 | UNKNOWN | - | 0 to b924696b2e8731f39696584d12cceeb3aeb2d874; 0 to 1.5.3 | b924696b2e8731f39696584d12cceeb3aeb2d874 | HKDF in cryptography before 1.5.2 returns an empty byte-string if used with a length less than algorithm.digest_size. |
| CVE-2018-10903 | UNKNOWN | - | 1.9 to 2.3 | 2.3 | A flaw was found in python-cryptography versions between >=1.9.0 and <2.3. The finalize_with_tag API did not enforce a minimum tag length. If a user did not validate the input length prior to passing |
| CVE-2020-25659 | UNKNOWN | - | 0 to 3.2.1 | 3.2.1 | python-cryptography 3.2 is vulnerable to Bleichenbacher timing attacks in the RSA decryption API, via timed processing of valid PKCS#1 v1.5 ciphertext. |
| CVE-2020-36242 | UNKNOWN | - | 3.1 to 3.3.2 | 3.3.2 | In the cryptography package before 3.3.2 for Python, certain sequences of update calls to symmetrically encrypt multi-GB values could result in an integer overflow and buffer overflow, as demonstrated |
| CVE-2023-23931 | UNKNOWN | - | 0 to 94a50a9731f35405f0357fa5f3b177d46a726ab3; 1.8 to 39.0.1 | 94a50a9731f35405f0357fa5f3b177d46a726ab3 | cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. In affected versions `Cipher.update_into` would accept Python objects which implement the buffer |
| CVE-2023-38325 | UNKNOWN | - | 40.0.0 to 41.0.2 | 41.0.2 | The cryptography package before 41.0.2 for Python mishandles SSH certificates that have critical options. |
| CVE-2023-49083 | UNKNOWN | - | 0 to f09c261ca10a31fe41b1262306db7f8f1da0e48a; 3.1 to 41.0.6 | f09c261ca10a31fe41b1262306db7f8f1da0e48a | cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. Calling `load_pem_pkcs7_certificates` or `load_der_pkcs7_certificates` could lead to a NULL-poin |
| CVE-2024-26130 | UNKNOWN | - | 0 to 97d231672763cdb5959a3b191e692a362f1b9e55; 38.0.0 to 42.0.4 | 97d231672763cdb5959a3b191e692a362f1b9e55 | 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_certificate |
| CVE-2026-34073 | UNKNOWN | - | 0 to 46.0.6 | 46.0.6 | cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. Prior to version 46.0.6, DNS name constraints were only validated against SANs within child cert |
| CVE-2026-39892 | UNKNOWN | - | 45.0.0 to 46.0.7 | 46.0.7 | cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. From 45.0.0 to before 46.0.7, if a non-contiguous buffer was passed to APIs which accepted Pytho |
Security Recommendations
- Pin cryptography to the latest stable version (48.0.0) in your dependency manifest
- Enable automated dependency updates with Dependabot or Renovate
- Run regular vulnerability scans using
pip-audit - Review your lock file (requirements.txt) after every update
- Monitor the OSV database and NIST NVD for new advisories
FAQ
Is cryptography safe to use?
cryptography is actively maintained and widely used. As of 2026-05-24, there are 30 known vulnerabilities listed in the OSV database. Most have patches available. Keeping your dependencies updated and running regular security audits significantly reduces risk.
What vulnerabilities does cryptography have?
The OSV database currently lists 30 vulnerabilities for cryptography. These range in severity and are detailed in the vulnerability table above. Check the linked advisories for full technical details and remediation guidance.
How do I update cryptography to fix vulnerabilities?
Run pip install --upgrade cryptography to get the newest version. Use pip-audit or safety check to scan for known vulnerabilities. Pin your dependencies with a requirements file and review updates regularly.
Using AI-Generated Code with cryptography?
Our vibe coding security audit checks for misconfigurations, exposed secrets and vulnerable dependencies in AI-generated codebases. If your project uses cryptography, we can verify it is locked to a safe version and properly configured.
Get a Vibe Coding Security Audit