CVE-2026-39892: Cryptography vulnerable to 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
debian/python-cryptographyto a version that resolves this vulnerability.Fixed in 46.0.7-1 - Upgrade
Upgrade
debian/python-cryptographyto a version that resolves this vulnerability.Fixed in 38.0.4-3+deb12u1Fixed in 38.0.4-3~deb12u1Fixed in 43.0.0-3+deb13u1Fixed in 49.0.0-2 - Upgrade
Upgrade
cryptographyto a version that resolves this vulnerability.Fixed in 46.0.7