CVE-2023-23931: pyca cryptography · Unchecked Error Condition
Affects pyca cryptographySource CVE Database V5
Not known to be exploited · CVSS 4.8 Medium : upgrade to 1.8 when convenient.
Data as of 26 Oct 2026, 17:16 UTC
- EPSS
- 1.3% chance of exploitation in 30 days – higher than 70% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 1.8
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:LExploitation evidence
Disclosed: evidence found.
CVE published 7 Feb 2023
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade pyca cryptography to 1.8.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
PyPIcryptographypkg:pypi/cryptographyOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
The most effective mitigation is to upgrade the pyca cryptography package to version 39.0.1 or later, where the vulnerability is fixed by raising exceptions when immutable buffers are passed to Cipher.update_into. Organizations should audit their Python environments and dependencies to identify usage of vulnerable versions (>=1.8, <39.0.1) and apply updates promptly. For environments where immediate upgrade is not feasible, developers should review code paths invoking update_into to ensure only mutable buffer objects are passed, avoiding immutable types like bytes. Implementing rigorous input validation and buffer type checks before cryptographic operations can reduce risk. Additionally, incorporating integrity checks and monitoring cryptographic outputs for anomalies can help detect potential exploitation or corruption. Security teams should also verify that their software supply chain and CI/CD pipelines enforce dependency version controls to prevent reintroduction of vulnerable versions. Finally, maintaining awareness of pyca cryptography releases and security advisories will support timely response to future vulnerabilities.
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.
References
- github.com/pyca/cryptography/security/advisories/GHSA-w7pp-m8wf-vj6r (opens in a new tab)
- github.com/pyca/cryptography/pull/8230/commits/94a50a9731f35405f0357fa5f3b177d46a726ab3 (opens in a new tab)
- security.netapp.com/advisory/ntap-20230324-0007/ (opens in a new tab)
- lists.debian.org/debian-lts-announce/2024/10/msg00012.html (opens in a new tab)