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.

Severity (CVSS 3.1)4.8Medium
Exploit odds (30 days)1.3%top 29.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
AlmaLinux:8python3-cryptography3.2.1-6.el8ALSA-2023:7096
AlmaLinux:9python3-cryptography36.0.1-4.el9ALSA-2023:6615
AlmaLinux:8python393.9.18-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-Cython0.29.21-5.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-Cython0.29.21-5.module_el8.6.0+3248+c431e88cALSA-2024:2985
AlmaLinux:8python39-PyMySQL0.10.1-2.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-attrs20.3.0-2.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-cffi1.14.3-2.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-cffi1.14.3-2.module_el8.6.0+3248+c431e88cALSA-2024:2985
AlmaLinux:8python39-chardet3.0.4-19.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-cryptography3.3.1-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-debug3.9.18-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-devel3.9.18-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-idle3.9.18-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-idna2.10-3.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-iniconfig1.1.1-2.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-libs3.9.18-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-lxml4.6.5-1.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-lxml4.6.5-1.module_el8.6.0+3248+c431e88cALSA-2024:2985
AlmaLinux:8python39-mod_wsgi4.7.1-7.module_el8.9.0+3634+fb2a896cALSA-2024:2985
AlmaLinux:8python39-more-itertools8.5.0-2.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-numpy1.19.4-3.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-numpy1.19.4-3.module_el8.6.0+3248+c431e88cALSA-2024:2985
AlmaLinux:8python39-numpy-doc1.19.4-3.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-numpy-f2py1.19.4-3.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-numpy-f2py1.19.4-3.module_el8.6.0+3248+c431e88cALSA-2024:2985
AlmaLinux:8python39-packaging20.4-4.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-pip20.2.4-9.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-pip-wheel20.2.4-9.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-pluggy0.13.1-3.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-ply3.11-10.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-psutil5.8.0-4.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-psutil5.8.0-4.module_el8.6.0+3248+c431e88cALSA-2024:2985
AlmaLinux:8python39-psycopg22.8.6-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-psycopg2-doc2.8.6-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-psycopg2-tests2.8.6-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-py1.10.0-1.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-pybind112.7.1-1.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-pybind112.7.1-1.module_el8.6.0+3248+c431e88cALSA-2024:2985
AlmaLinux:8python39-pybind11-devel2.7.1-1.module_el8.6.0+3248+c431e88cALSA-2024:2985
AlmaLinux:8python39-pybind11-devel2.7.1-1.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-pycparser2.20-3.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-pyparsing2.4.7-5.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-pysocks1.7.1-4.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-pytest6.0.2-2.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-pyyaml5.4.1-1.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-pyyaml5.4.1-1.module_el8.6.0+3248+c431e88cALSA-2024:2985
AlmaLinux:8python39-requests2.25.0-3.module_el8.9.0+3634+fb2a896cALSA-2024:2985
AlmaLinux:8python39-rpm-macros3.9.18-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-scipy1.5.4-5.module_el8.9.0+3634+fb2a896cALSA-2024:2985
AlmaLinux:8python39-setuptools50.3.2-5.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-setuptools-wheel50.3.2-5.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-six1.15.0-3.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-test3.9.18-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-tkinter3.9.18-3.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-toml0.10.1-5.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-urllib31.25.10-5.module_el8.10.0+3765+2f9a457dALSA-2024:2985
AlmaLinux:8python39-wcwidth0.2.5-3.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-wheel1:0.35.1-4.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
AlmaLinux:8python39-wheel-wheel1:0.35.1-4.module_el8.6.0+2780+a40f65e1ALSA-2024:2985
Alpine:v3.20py3-cryptography39.0.1-r0ALPINE-CVE-2023-23931
Alpine:v3.21py3-cryptography39.0.1-r0ALPINE-CVE-2023-23931
Alpine:v3.22py3-cryptography39.0.1-r0ALPINE-CVE-2023-23931
Alpine:v3.23py3-cryptography39.0.1-r0ALPINE-CVE-2023-23931
Alpine:v3.24py3-cryptography39.0.1-r0ALPINE-CVE-2023-23931
Debian:12python-cryptography38.0.4-3DEBIAN-CVE-2023-23931
Debian:13python-cryptography38.0.4-3DEBIAN-CVE-2023-23931
Debian:14python-cryptography38.0.4-3DEBIAN-CVE-2023-23931
PyPIcryptography39.0.1GHSA-w7pp-m8wf-vj6r
PyPIcryptography39.0.1PYSEC-2023-11
Rocky Linux:8Cython0:0.29.21-5.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8PyYAML0:5.4.1-1.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8mod_wsgi0:4.7.1-7.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8numpy0:1.19.4-3.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8pybind110:2.7.1-1.module+el8.9.0+1357+a3b80af7RLSA-2024:2985
Rocky Linux:8pytest0:6.0.2-2.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-PyMySQL0:0.10.1-2.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-attrs0:20.3.0-2.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-cffi0:1.14.3-2.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-chardet0:3.0.4-19.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-cryptography0:3.3.1-3.module+el8.10.0+1697+7e517775RLSA-2024:2985
Rocky Linux:8python-iniconfig0:1.1.1-2.module+el8.9.0+1332+dd574197RLSA-2024:2985
Rocky Linux:8python-lxml0:4.6.5-1.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-more-itertools0:8.5.0-2.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-packaging0:20.4-4.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-pluggy0:0.13.1-3.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-ply0:3.11-10.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-psutil0:5.8.0-4.module+el8.9.0+1357+a3b80af7RLSA-2024:2985
Rocky Linux:8python-psycopg20:2.8.6-3.module+el8.10.0+1660+b5b6f004RLSA-2024:2985
Rocky Linux:8python-py0:1.10.0-1.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-pycparser0:2.20-3.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-pysocks0:1.7.1-4.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-requests0:2.25.0-3.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-toml0:0.10.1-5.module+el8.9.0+1332+dd574197RLSA-2024:2985
Rocky Linux:8python-urllib30:1.25.10-5.module+el8.10.0+1545+03246da9RLSA-2024:2985
Rocky Linux:8python-wcwidth0:0.2.5-3.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python-wheel1:0.35.1-4.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python3x-pip0:20.2.4-9.module+el8.10.0+1721+e52d6351RLSA-2024:2985
Rocky Linux:8python3x-pyparsing0:2.4.7-5.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python3x-setuptools0:50.3.2-5.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8python3x-six0:1.15.0-3.module+el8.10.0+1582+bc278001RLSA-2024:2985
Rocky Linux:8scipy0:1.5.4-5.module+el8.10.0+1582+bc278001RLSA-2024:2985
Ubuntu:22.04:LTSpython-cryptography3.4.8-1ubuntu2.1UBUNTU-CVE-2023-23931
Ubuntu:22.04:LTSpython-cryptography3.4.8-1ubuntu2.1USN-6539-1
Ubuntu:26.04:LTSpython-cryptography46.0.5-1ubuntu2.2USN-8776-1

Affected products (as reported)

VendorProductVersions
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