Python/cryptography/1.3
cryptography is a package which provides cryptographic recipes and primitives to Python developers.
https://pypi.org/project/cryptography
Apache-2.0 AND BSD
10 Security Vulnerabilities
Python Cryptography package vulnerable to Bleichenbacher timing oracle attack
A flaw was found in the python-cryptography package. This issue may allow a remote attacker to decrypt captured messages in TLS servers that use RSA key exchanges, which may lead to exposure of confidential or sensitive data.
Vulnerable OpenSSL included in cryptography wheels
pyca/cryptography's wheels include a statically linked copy of OpenSSL. The versions of OpenSSL included in wheels prior to cryptograph 48.01 are vulnerable to a security issue. More details about the vulnerability itself can be found in https://openssl-library.org/news/secadv/20260609.txt.
If you are building cryptography source (sdist
) then you are responsible for upgrading your copy of OpenSSL. Only users installing from wheels built by the cryptography project (i.e., those distributed on PyPI) need to update their cryptography versions.
Vulnerable OpenSSL included in cryptography wheels
pyca/cryptography's wheels include a statically linked copy of OpenSSL. The versions of OpenSSL included in cryptography 0.5-40.0.2 are vulnerable to a security issue. More details about the vulnerability itself can be found in https://www.openssl.org/news/secadv/20230530.txt.
If you are building cryptography source (sdist
) then you are responsible for upgrading your copy of OpenSSL. Only users installing from wheels built by the cryptography project (i.e., those distributed on PyPI) need to update their cryptography versions.
Null pointer dereference in PKCS12 parsing
- https://nvd.nist.gov/vuln/detail/CVE-2024-0727
- https://github.com/openssl/openssl/commit/09df4395b5071217b76dc7d3d2e630eb8c5a79c2
- https://github.com/openssl/openssl/commit/775acfdbd0c6af9ac855f34969cdab0c0c90844a
- https://github.com/openssl/openssl/commit/d135eeab8a5dbf72b3da5240bab9ddb7678dbd2c
- https://github.openssl.org/openssl/extended-releases/commit/03b3941d60c4bce58fab69a0c22377ab439bc0e8
- https://github.openssl.org/openssl/extended-releases/commit/aebaa5883e31122b404e450732dc833dc9dee539
- https://www.openssl.org/news/secadv/20240125.txt
- https://github.com/github/advisory-database/pull/3472
- https://github.com/openssl/openssl/pull/23362
- https://github.com/alexcrichton/openssl-src-rs/commit/add20f73b6b42be7451af2e1044d4e0e778992b2
- https://github.com/pyca/cryptography/commit/3519591d255d4506fbcd0d04037d45271903c64d
- https://security.netapp.com/advisory/ntap-20240208-0006
- https://github.com/advisories/GHSA-9v9h-cgj8-h64p
- http://www.openwall.com/lists/oss-security/2024/03/11/1
- https://lists.debian.org/debian-lts-announce/2024/10/msg00033.html
- https://lists.debian.org/debian-lts-announce/2024/11/msg00000.html
- https://cert-portal.siemens.com/productcert/html/ssa-915275.html
- https://cert-portal.siemens.com/productcert/html/ssa-769027.html
- https://cert-portal.siemens.com/productcert/html/ssa-331112.html
- https://cert-portal.siemens.com/productcert/html/ssa-277137.html
- https://cert-portal.siemens.com/productcert/html/ssa-265688.html
Issue summary: Processing a maliciously formatted PKCS12 file may lead OpenSSL to crash leading to a potential Denial of Service attack
Impact summary: Applications loading files in the PKCS12 format from untrusted sources might terminate abruptly.
A file in PKCS12 format can contain certificates and keys and may come from an untrusted source. The PKCS12 specification allows certain fields to be NULL, but OpenSSL does not correctly check for this case. This can lead to a NULL pointer dereference that results in OpenSSL crashing. If an application processes PKCS12 files from an untrusted source using the OpenSSL APIs then that application will be vulnerable to this issue.
OpenSSL APIs that are vulnerable to this are: PKCS12parse(), PKCS12unpackp7data(), PKCS12unpackp7encdata(), PKCS12unpackauthsafes() and PKCS12newpass().
We have also fixed a similar issue in SMIMEwritePKCS7(). However since this function is related to writing data we do not consider it security significant.
The FIPS modules in 3.2, 3.1 and 3.0 are not affected by this issue.
RSA decryption vulnerable to Bleichenbacher timing vulnerability
- https://github.com/pyca/cryptography/security/advisories/GHSA-hggm-jpg3-v476
- https://nvd.nist.gov/vuln/detail/CVE-2020-25659
- https://github.com/advisories/GHSA-hggm-jpg3-v476
- https://github.com/pyca/cryptography/commit/58494b41d6ecb0f56b7c5f05d5f5e3ca0320d494
- https://pypi.org/project/cryptography/
- https://github.com/pyca/cryptography/pull/5507/commits/ce1bef6f1ee06ac497ca0c837fbd1c7ef6c2472b
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpujul2022.html
- https://github.com/pyca/cryptography/pull/5507
- https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2021-62.yaml
- https://pypi.org/project/cryptography
RSA decryption was vulnerable to Bleichenbacher timing vulnerabilities, which would impact people using RSA decryption in online scenarios. This is fixed in cryptography 3.2.
pyca/cryptography's wheels include vulnerable OpenSSL
- https://github.com/pyca/cryptography/security/advisories/GHSA-jm77-qphf-c4w8
- https://github.com/pyca/cryptography/commit/b22271cf3c3dd8dc8978f8f4b00b5c7060b6538d
- https://github.com/pyca/cryptography/commit/bfa4d95f0f356f2d535efd5c775e0fb3efe90ef2
- https://www.openssl.org/news/secadv/20230714.txt
- https://www.openssl.org/news/secadv/20230719.txt
- https://www.openssl.org/news/secadv/20230731.txt
- https://github.com/advisories/GHSA-jm77-qphf-c4w8
pyca/cryptography's wheels include a statically linked copy of OpenSSL. The versions of OpenSSL included in cryptography 0.8-41.0.2 are vulnerable to several security issues. More details about the vulnerabilities themselves can be found in https://www.openssl.org/news/secadv/20230731.txt, https://www.openssl.org/news/secadv/20230719.txt, and https://www.openssl.org/news/secadv/20230714.txt.
If you are building cryptography source (sdist
) then you are responsible for upgrading your copy of OpenSSL. Only users installing from wheels built by the cryptography project (i.e., those distributed on PyPI) need to update their cryptography versions.
cryptography has incomplete DNS name constraint enforcement on peer names
Summary
In versions of cryptography prior to 46.0.5, DNS name constraints were only validated against SANs within child certificates, and not the peer name
presented during each validation. Consequently, cryptography would allow a peer named bar.example.com to validate against a wildcard leaf certificate for *.example.com, even if the leaf's parent certificate (or upwards) contained an excluded subtree constraint for bar.example.com.
This behavior resulted from a gap between RFC 5280 (which defines Name Constraint semantics) and RFC 9525 (which defines service identity semantics): put together, neither states definitively whether Name Constraints should be applied to peer names. To close this gap, cryptography now conservatively rejects any validation where the peer name would be rejected by a name constraint if it were a SAN instead.
In practice, exploitation of this bypass requires an uncommon X.509 topology, one that the Web PKI avoids because it exhibits these kinds of problems. Consequently, we consider this a medium-to-low impact severity.
See CVE-2025-61727 for a similar bypass in Go's crypto/x509.
Remediation
Users should upgrade to 46.0.6 or newer.
Attribution
Reporter: @1seal
Improper input validation in cryptography
- https://nvd.nist.gov/vuln/detail/CVE-2016-9243
- https://github.com/pyca/cryptography/issues/3211
- https://github.com/pyca/cryptography/commit/b924696b2e8731f39696584d12cceeb3aeb2d874
- https://cryptography.io/en/latest/changelog
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5R2ZOBMPWDFFHUZ6QOZZY36A6H5CGJXL/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U23KDR2M2N7W2ZSREG63BVW7D4VC6CIZ/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WQ5G7KHKZC4SI23JE7277KZXM57GEQKT/
- http://www.openwall.com/lists/oss-security/2016/11/09/2
- http://www.ubuntu.com/usn/USN-3138-1
- https://cryptography.io/en/latest/changelog/#v1-5-3
- https://github.com/advisories/GHSA-q3cj-2r34-2cwc
- https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2017-8.yaml
- http://www.securityfocus.com/bid/94216
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5R2ZOBMPWDFFHUZ6QOZZY36A6H5CGJXL
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/U23KDR2M2N7W2ZSREG63BVW7D4VC6CIZ
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WQ5G7KHKZC4SI23JE7277KZXM57GEQKT
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5R2ZOBMPWDFFHUZ6QOZZY36A6H5CGJXL
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U23KDR2M2N7W2ZSREG63BVW7D4VC6CIZ
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WQ5G7KHKZC4SI23JE7277KZXM57GEQKT
HKDF in cryptography before 1.5.3 returns an empty byte-string if used with a length less than algorithm.digest_size.
cryptography Vulnerable to a Subgroup Attack Due to Missing Subgroup Validation for SECT Curves
- https://github.com/pyca/cryptography/security/advisories/GHSA-r6ph-v2qm-q3c2
- https://github.com/pyca/cryptography/commit/0eebb9dbb6343d9bc1d91e5a2482ed4e054a6d8c
- https://github.com/pyca/cryptography/releases/tag/46.0.5
- https://github.com/advisories/GHSA-r6ph-v2qm-q3c2
- https://nvd.nist.gov/vuln/detail/CVE-2026-26007
- http://www.openwall.com/lists/oss-security/2026/02/10/4
Vulnerability Summary
The public_key_from_numbers (or EllipticCurvePublicNumbers.public_key()), EllipticCurvePublicNumbers.public_key(), load_der_public_key() and load_pem_public_key() functions do not verify that the point belongs to the expected prime-order subgroup of the curve.
This missing validation allows an attacker to provide a public key point P from a small-order subgroup. This can lead to security issues in various situations, such as the most commonly used signature verification (ECDSA) and shared key negotiation (ECDH). When the victim computes the shared secret as S = [victim_private_key]P via ECDH, this leaks information about victim_private_key mod (small_subgroup_order). For curves with cofactor > 1, this reveals the least significant bits of the private key. When these weak public keys are used in ECDSA , it's easy to forge signatures on the small subgroup.
Only SECT curves are impacted by this.
Credit
This vulnerability was discovered by: - XlabAI Team of Tencent Xuanwu Lab - Atuin Automated Vulnerability Discovery Engine
Vulnerable OpenSSL included in cryptography wheels
- https://github.com/pyca/cryptography/security/advisories/GHSA-x4qr-2fvf-3mr5
- https://nvd.nist.gov/vuln/detail/CVE-2023-0286
- https://rustsec.org/advisories/RUSTSEC-2023-0006.html
- https://www.openssl.org/news/secadv/20230207.txt
- https://github.com/advisories/GHSA-x4qr-2fvf-3mr5
- https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=2c6c9d439b484e1ba9830d8454a34fa4f80fdfe9
- https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=2f7530077e0ef79d98718138716bc51ca0cad658
- https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=fd2af07dc083a350c959147097003a14a5e8ac4d
- https://access.redhat.com/security/cve/cve-2023-0286
- https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.6.2-relnotes.txt
- https://ftp.openbsd.org/pub/OpenBSD/patches/7.2/common/018_x509.patch.sig
- https://security.gentoo.org/glsa/202402-08
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2023-0003
pyca/cryptography's wheels include a statically linked copy of OpenSSL. The versions of OpenSSL included in cryptography 0.8.1-39.0.0 are vulnerable to a security issue. More details about the vulnerabilities themselves can be found in https://www.openssl.org/news/secadv/20221213.txt and https://www.openssl.org/news/secadv/20230207.txt.
If you are building cryptography source (sdist
) then you are responsible for upgrading your copy of OpenSSL. Only users installing from wheels built by the cryptography project (i.e., those distributed on PyPI) need to update their cryptography versions.
158 Other Versions
| Version | License | Security | Released | |
|---|---|---|---|---|
| 2.1.2 | Apache-2.0 AND BSD | 11 | 2017-10-24 - 15:50 | over 8 years |
| 2.1.1 | Apache-2.0 AND BSD | 11 | 2017-10-12 - 05:35 | over 8 years |
| 2.1 | Apache-2.0 AND BSD | 11 | 2017-10-11 - 12:56 | over 8 years |
| 2.0.3 | Apache-2.0 AND BSD | 11 | 2017-08-03 - 22:03 | almost 9 years |
| 2.0.2 | Apache-2.0 AND BSD | 11 | 2017-07-27 - 03:28 | almost 9 years |
| 2.0.1 | Apache-2.0 AND BSD | 11 | 2017-07-26 - 20:23 | almost 9 years |
| 2.0 | Apache-2.0 AND BSD | 11 | 2017-07-17 - 15:44 | almost 9 years |
| 1.9 | Apache-2.0 AND BSD | 11 | 2017-05-30 - 02:33 | about 9 years |
| 1.8.2 | Apache-2.0 AND BSD | 10 | 2017-05-26 - 06:42 | about 9 years |
| 1.8.1 | Apache-2.0 AND BSD | 10 | 2017-03-10 - 04:05 | over 9 years |
| 1.8 | Apache-2.0 AND BSD | 10 | 2017-03-10 - 03:05 | over 9 years |
| 1.7.2 | Apache-2.0 AND BSD | 9 | 2017-02-12 - 15:23 | over 9 years |
| 1.7.1 | Apache-2.0 AND BSD | 9 | 2016-12-13 - 23:01 | over 9 years |
| 1.7 | Apache-2.0 AND BSD | 9 | 2016-12-12 - 18:31 | over 9 years |
| 1.6 | Apache-2.0 AND BSD | 9 | 2016-11-22 - 03:29 | over 9 years |
| 1.5.3 | Apache-2.0 AND BSD | 9 | 2016-11-06 - 04:18 | over 9 years |
| 1.5.2 | Apache-2.0 AND BSD | 10 | 2016-09-26 - 20:29 | over 9 years |
| 1.5.1 | Apache-2.0 AND BSD | 10 | 2016-09-22 - 20:15 | over 9 years |
| 1.5 | Apache-2.0 AND BSD | 10 | 2016-08-26 - 15:51 | almost 10 years |
| 1.4 | Apache-2.0 AND BSD | 10 | 2016-06-04 - 17:15 | about 10 years |
| 1.3.4 | Apache-2.0 AND BSD | 10 | 2016-06-03 - 03:17 | about 10 years |
| 1.3.3 | Apache-2.0 AND BSD | 10 | 2016-06-02 - 21:50 | about 10 years |
| 1.3.2 | Apache-2.0 AND BSD | 10 | 2016-05-04 - 16:19 | about 10 years |
| 1.3.1 | Apache-2.0 AND BSD | 10 | 2016-03-21 - 21:57 | about 10 years |
| 1.3 | Apache-2.0 AND BSD | 10 | 2016-03-18 - 13:20 | over 10 years |
| 1.2.3 | Apache-2.0 AND BSD | 10 | 2016-03-02 - 02:15 | over 10 years |
| 1.2.2 | Apache-2.0 AND BSD | 10 | 2016-01-29 - 19:31 | over 10 years |
| 1.2.1 | Apache-2.0 AND BSD | 10 | 2016-01-08 - 21:33 | over 10 years |
| 1.2 | Apache-2.0 AND BSD | 10 | 2016-01-08 - 15:44 | over 10 years |
| 1.1.2 | Apache-2.0 AND BSD | 10 | 2015-12-10 - 19:59 | over 10 years |
| 1.1.1 | Apache-2.0 AND BSD | 10 | 2015-11-19 - 04:06 | over 10 years |
| 1.1 | Apache-2.0 AND BSD | 10 | 2015-10-28 - 22:43 | over 10 years |
| 1.0.2 | Apache-2.0 AND BSD | 10 | 2015-09-27 - 13:55 | over 10 years |
| 1.0.1 | Apache-2.0 AND BSD | 10 | 2015-09-06 - 01:57 | almost 11 years |
| 1.0 | Apache-2.0 AND BSD | 10 | 2015-08-12 - 13:40 | almost 11 years |
| 0.9.3 | Apache-2.0 AND BSD | 10 | 2015-07-09 - 14:45 | almost 11 years |
| 0.9.2 | Apache-2.0 AND BSD | 10 | 2015-07-03 - 23:01 | almost 11 years |
| 0.9.1 | Apache-2.0 AND BSD | 10 | 2015-06-06 - 21:26 | about 11 years |
| 0.9 | Apache-2.0 AND BSD | 10 | 2015-05-14 - 01:42 | about 11 years |
| 0.8.2 | Apache-2.0 AND BSD | 10 | 2015-04-11 - 02:01 | about 11 years |
| 0.8.1 | Apache-2.0 AND BSD | 10 | 2015-03-20 - 15:35 | over 11 years |
| 0.8 | Apache-2.0 AND BSD | 9 | 2015-03-09 - 04:53 | over 11 years |
| 0.7.2 | Apache-2.0 AND BSD | 8 | 2015-01-16 - 14:19 | over 11 years |
| 0.7.1 | Apache-2.0 AND BSD | 8 | 2014-12-29 - 01:54 | over 11 years |
| 0.7 | Apache-2.0 AND BSD | 8 | 2014-12-18 - 03:34 | over 11 years |
| 0.6.1 | Apache-2.0 | 8 | 2014-10-16 - 04:22 | over 11 years |
| 0.6 | Apache-2.0 | 8 | 2014-09-30 - 02:37 | over 11 years |
| 0.5.4 | Apache-2.0 | 8 | 2014-08-21 - 06:12 | almost 12 years |
| 0.5.3 | Apache-2.0 | 8 | 2014-08-07 - 15:33 | almost 12 years |
| 0.5.2 | Apache-2.0 | 8 | 2014-07-10 - 01:32 | almost 12 years |
