Vulnerability · Published Feb 7, 2023 · Assigned by GitHub_M
CVE-2023-23931Cipher.update_into can corrupt memory in pyca cryptography
Medium 4.8
In plain English
A medium-severity security flaw in cryptography from pyca. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.3% (higher than 71% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | python3-cryptography | 3.2.1-6.el8 | ALSA-2023:7096 |
| AlmaLinux:9 | python3-cryptography | 36.0.1-4.el9 | ALSA-2023:6615 |
| AlmaLinux:8 | python39 | 3.9.18-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-Cython | 0.29.21-5.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-Cython | 0.29.21-5.module_el8.6.0+3248+c431e88c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-PyMySQL | 0.10.1-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-attrs | 20.3.0-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-cffi | 1.14.3-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-cffi | 1.14.3-2.module_el8.6.0+3248+c431e88c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-chardet | 3.0.4-19.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-cryptography | 3.3.1-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-debug | 3.9.18-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-devel | 3.9.18-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-idle | 3.9.18-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-idna | 2.10-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-iniconfig | 1.1.1-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-libs | 3.9.18-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-lxml | 4.6.5-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-lxml | 4.6.5-1.module_el8.6.0+3248+c431e88c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-mod_wsgi | 4.7.1-7.module_el8.9.0+3634+fb2a896c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-more-itertools | 8.5.0-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-numpy | 1.19.4-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-numpy | 1.19.4-3.module_el8.6.0+3248+c431e88c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-numpy-doc | 1.19.4-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-numpy-f2py | 1.19.4-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-numpy-f2py | 1.19.4-3.module_el8.6.0+3248+c431e88c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-packaging | 20.4-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pip | 20.2.4-9.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pip-wheel | 20.2.4-9.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pluggy | 0.13.1-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-ply | 3.11-10.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-psutil | 5.8.0-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-psutil | 5.8.0-4.module_el8.6.0+3248+c431e88c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-psycopg2 | 2.8.6-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-psycopg2-doc | 2.8.6-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-psycopg2-tests | 2.8.6-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-py | 1.10.0-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pybind11 | 2.7.1-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pybind11 | 2.7.1-1.module_el8.6.0+3248+c431e88c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pybind11-devel | 2.7.1-1.module_el8.6.0+3248+c431e88c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pybind11-devel | 2.7.1-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pycparser | 2.20-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pyparsing | 2.4.7-5.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pysocks | 1.7.1-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pytest | 6.0.2-2.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pyyaml | 5.4.1-1.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-pyyaml | 5.4.1-1.module_el8.6.0+3248+c431e88c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-requests | 2.25.0-3.module_el8.9.0+3634+fb2a896c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-rpm-macros | 3.9.18-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-scipy | 1.5.4-5.module_el8.9.0+3634+fb2a896c | ALSA-2024:2985 |
| AlmaLinux:8 | python39-setuptools | 50.3.2-5.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-setuptools-wheel | 50.3.2-5.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-six | 1.15.0-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-test | 3.9.18-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-tkinter | 3.9.18-3.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-toml | 0.10.1-5.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-urllib3 | 1.25.10-5.module_el8.10.0+3765+2f9a457d | ALSA-2024:2985 |
| AlmaLinux:8 | python39-wcwidth | 0.2.5-3.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-wheel | 1:0.35.1-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| AlmaLinux:8 | python39-wheel-wheel | 1:0.35.1-4.module_el8.6.0+2780+a40f65e1 | ALSA-2024:2985 |
| Alpine:v3.20 | py3-cryptography | 39.0.1-r0 | ALPINE-CVE-2023-23931 |
| Alpine:v3.21 | py3-cryptography | 39.0.1-r0 | ALPINE-CVE-2023-23931 |
| Alpine:v3.22 | py3-cryptography | 39.0.1-r0 | ALPINE-CVE-2023-23931 |
| Alpine:v3.23 | py3-cryptography | 39.0.1-r0 | ALPINE-CVE-2023-23931 |
| Alpine:v3.24 | py3-cryptography | 39.0.1-r0 | ALPINE-CVE-2023-23931 |
| Debian:12 | python-cryptography | 38.0.4-3 | DEBIAN-CVE-2023-23931 |
| Debian:13 | python-cryptography | 38.0.4-3 | DEBIAN-CVE-2023-23931 |
| Debian:14 | python-cryptography | 38.0.4-3 | DEBIAN-CVE-2023-23931 |
| PyPI | cryptography | 39.0.1 | GHSA-w7pp-m8wf-vj6r |
| PyPI | cryptography | 39.0.1 | PYSEC-2023-11 |
| Rocky Linux:8 | Cython | 0:0.29.21-5.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | PyYAML | 0:5.4.1-1.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | mod_wsgi | 0:4.7.1-7.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | numpy | 0:1.19.4-3.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | pybind11 | 0:2.7.1-1.module+el8.9.0+1357+a3b80af7 | RLSA-2024:2985 |
| Rocky Linux:8 | pytest | 0:6.0.2-2.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-PyMySQL | 0:0.10.1-2.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-attrs | 0:20.3.0-2.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-cffi | 0:1.14.3-2.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-chardet | 0:3.0.4-19.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-cryptography | 0:3.3.1-3.module+el8.10.0+1697+7e517775 | RLSA-2024:2985 |
| Rocky Linux:8 | python-iniconfig | 0:1.1.1-2.module+el8.9.0+1332+dd574197 | RLSA-2024:2985 |
| Rocky Linux:8 | python-lxml | 0:4.6.5-1.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-more-itertools | 0:8.5.0-2.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-packaging | 0:20.4-4.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-pluggy | 0:0.13.1-3.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-ply | 0:3.11-10.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-psutil | 0:5.8.0-4.module+el8.9.0+1357+a3b80af7 | RLSA-2024:2985 |
| Rocky Linux:8 | python-psycopg2 | 0:2.8.6-3.module+el8.10.0+1660+b5b6f004 | RLSA-2024:2985 |
| Rocky Linux:8 | python-py | 0:1.10.0-1.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-pycparser | 0:2.20-3.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-pysocks | 0:1.7.1-4.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-requests | 0:2.25.0-3.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-toml | 0:0.10.1-5.module+el8.9.0+1332+dd574197 | RLSA-2024:2985 |
| Rocky Linux:8 | python-urllib3 | 0:1.25.10-5.module+el8.10.0+1545+03246da9 | RLSA-2024:2985 |
| Rocky Linux:8 | python-wcwidth | 0:0.2.5-3.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python-wheel | 1:0.35.1-4.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python3x-pip | 0:20.2.4-9.module+el8.10.0+1721+e52d6351 | RLSA-2024:2985 |
| Rocky Linux:8 | python3x-pyparsing | 0:2.4.7-5.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python3x-setuptools | 0:50.3.2-5.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | python3x-six | 0:1.15.0-3.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Rocky Linux:8 | scipy | 0:1.5.4-5.module+el8.10.0+1582+bc278001 | RLSA-2024:2985 |
| Ubuntu:22.04:LTS | python-cryptography | 3.4.8-1ubuntu2.1 | UBUNTU-CVE-2023-23931 |
| Ubuntu:22.04:LTS | python-cryptography | 3.4.8-1ubuntu2.1 | USN-6539-1 |
| Ubuntu:26.04:LTS | python-cryptography | 46.0.5-1ubuntu2.2 | USN-8776-1 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| pyca | cryptography | >=1.8, < 39.0.1 |
Weakness: CWE-754 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L
References
- https://github.com/pyca/cryptography/security/advisories/GHSA-w7pp-m8wf-vj6r x_refsource_CONFIRM
- https://github.com/pyca/cryptography/pull/8230/commits/94a50a9731f35405f0357fa5f3b177d46a726ab3 x_refsource_MISC
- https://security.netapp.com/advisory/ntap-20230324-0007/
- https://lists.debian.org/debian-lts-announce/2024/10/msg00012.html