CVE-2023-23931
MEDIUM6.5EPSS 0.69%Cipher.update_into can corrupt memory if passed an immutable python object as the outbuf
Published: 2/7/2023Modified: 12/3/2025
Also known as:ALPINE-CVE-2023-23931
Description
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 protocol, but provide only immutable buffers. This would allow immutable objects (such as `bytes`) to be mutated, thus violating fundamental rules of Python and resulting in corrupted output. This now correctly raises an exception. This issue has been present since `update_into` was originally introduced in cryptography 1.8.
Affected packages (7)
- Alpine/py3-cryptographyfrom 0, < 39.0.1-r0
- Debian/python-cryptographyfrom 0, < 3.3.2-1+deb11u1
- Debian/python-cryptographyfrom 0, < 2.6.1-3+deb10u3
- Debian/python-cryptographyfrom 0, < 2.6.1-3+deb10u4
- Debian/python-cryptographyfrom 0, < 3.3.2-1+deb11u1
- PyPI/cryptography>= 1.8, < 39.0.1
- PyPI/cryptographyfrom 0, < 94a50a9731f35405f0357fa5f3b177d46a726ab3 | >= 1.8, < 39.0.1
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 4.0 | — | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N |
| osv | CVSS 3.1 | MEDIUM6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L |
References (11)
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2023-23931
- ADVISORYhttps://security.alpinelinux.org/vuln/CVE-2023-23931
- ADVISORYhttps://security-tracker.debian.org/tracker/CVE-2023-23931
- PATCHhttps://github.com/pyca/cryptography
- PATCHhttps://github.com/pyca/cryptography/pull/8230/commits/94a50a9731f35405f0357fa5f3b177d46a726ab3
- WEBhttps://github.com/pyca/cryptography/commit/d6951dca25de45abd52da51b608055371fbcde4e
- WEBhttps://github.com/pyca/cryptography/pull/8230
- WEBhttps://github.com/pyca/cryptography/security/advisories/GHSA-w7pp-m8wf-vj6r
- WEBhttps://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2023-11.yaml
- WEBhttps://lists.debian.org/debian-lts-announce/2024/10/msg00012.html
- WEBhttps://security.netapp.com/advisory/ntap-20230324-0007