CVE-2026-39892: cryptography has a buffer overflow if non-contiguous buffers were passed to APIs
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 Python buffers (e.g. Hash.update()), this could lead to buffer overflows. This vulnerability is fixed in 46.0.7.
Other sources
If a non-contiguous buffer was passed to APIs which accepted Python buffers (e.g. Hash.update()), this could lead to buffer overflows. For example:
python h = Hash(SHA256()) b.update(buf[::-1])
would read past the end of the buffer on Python >3.11
— GitHub
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/cryptographyto a version that resolves this vulnerability.Fixed in 46.0.7 - Upgrade
Upgrade
PyCA cryptographyto a version that resolves this vulnerability.Fixed in 46.0.7Patch CVE-2026-39892