Skip to main content
VulnerabilityPublished Updated

CVE-2023-23931: pyca cryptography · Unchecked Error Condition

Affects pyca cryptographySource CVE Database V5

0

Not known to be exploited · CVSS 4.8 Medium : upgrade to 1.8 when convenient.

Data as of 26 Oct 2026, 17:16 UTC

CVSS 3.1 base score
4.8Medium
How severe the flaw is on the 0–10 CVSS scale.
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:L

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 7 Feb 2023

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
PyPIcryptographypkg:pypi/cryptographyOther threatsAffected
  • <1.8
Fixed in
  • 1.8

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

Community reviews

Loading reviews…