CVE-2023-23931
Cipher.update_into can corrupt memory in pyca cryptography
Reported by github_m · Published February 7, 2023
cryptography is fixed in 39.0.1 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| cryptography | PyPI | 39.0.1 |
| py3-cryptography | Alpine | 39.0.1-r0, 38.0.3-r1 |
| python3-cryptography | Amazon Linux | 36.0.1-1.amzn2023.0.4 |
| mitmproxy | Wolfi | 12.2.1-r0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| pyca | cryptography | >=1.8, < 39.0.1 |
| alpine | py3-cryptography | 0, 0 |
| amazon:2023 | python3-cryptography | 0 |
| wolfi | mitmproxy | 0 |
| PyPI | cryptography | 1.8 |
| pyca | cryptography | 1.8 |
| pyca | cryptography | |
| chainguard | mitmproxy | 0 |
Timeline
- Feb 7, 2023 CVE Published
- Feb 8, 2023 EPSS Score (30 in total, the first dated here)
- Feb 21, 2026 Security Advisory (16 in total, the first dated here)
- Mar 21, 2026 Distribution Patch (13 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2023-23931
vulnetix vdb fixes CVE-2023-23931
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2023-23931/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
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/ url
- https://lists.debian.org/debian-lts-announce/2024/10/msg00012.html url
- https://nvd.nist.gov/vuln/detail/CVE-2023-23931 advisory
- https://github.com/advisories/GHSA-w7pp-m8wf-vj6r advisory
- https://github.com/pyca/cryptography/pull/8230 patch
- https://github.com/pyca/cryptography/commit/d6951dca25de45abd52da51b608055371fbcde4e patch
- https://github.com/pyca/cryptography url
- https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2023-11.yaml advisory
- https://security.netapp.com/advisory/ntap-20230324-0007 advisory