CVE-2023-23931

Publication date 7 February 2023

Last updated 17 September 2026


Ubuntu priority

Cvss 3 Severity Score

4.8 · Medium

Score breakdown

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.

Read the notes from the security team

Status

Package Ubuntu Release Status
python-cryptography 26.04 LTS resolute
Not affected
25.10 questing
Not affected
25.04 plucky
Not affected
24.10 oracular
Not affected
24.04 LTS noble
Not affected
23.10 mantic
Not affected
23.04 lunar
Fixed 38.0.4-2ubuntu0.1
22.10 kinetic Ignored end of life, was needed
22.04 LTS jammy
Fixed 3.4.8-1ubuntu2.1
20.04 LTS focal
Fixed 2.8-3ubuntu0.2
18.04 LTS bionic
Fixed 2.1.4-1ubuntu1.4+esm6
16.04 LTS xenial
Not affected
14.04 LTS trusty Not in release

Get expanded security coverage with Ubuntu Pro

Reduce your average CVE exposure time from 98 days to 1 day with expanded CVE patching, ten-years security maintenance and optional support for the full stack of open-source applications. Free for personal use.

Get Ubuntu Pro 30-day free trial

Notes


mdeslaur

Per the upstream advisory: "This is a soundness bug -- it allows programmers to misuse an API, it cannot be exploited by attacker controlled data alone."


seth-arnold

Debian's update was incomplete, see 2.6.1-3+deb10u4


ccdm94

as per the advisory, this vulnerability was introduced in version 1.8.


charlescochran

The patch uses require_writable=True in from_buffer(), but this wasn't added to python-cffi until 1.12.0 (see commit https://github.com/python-cffi/cffi/commit/4945de3df6a8f3bb2ee903a687f659a92aa8f11e), whereas bionic has 1.11.5-1. As a workaround for the bionic backport, use memoryview to check if the buffer is writable.

Patch details

For informational purposes only. We recommend not to cherry-pick updates. How can I get the fixes?

Package Patch details
python-cryptography

Severity score breakdown

CVSS version: CVSS v3.0

Base score 4.8 · Medium

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L

References

Related Ubuntu Security Notices (USN)

    • USN-6539-1
    • python-cryptography vulnerabilities
    • 6 December 2023
    • USN-8776-1
    • python-cryptography vulnerabilities
    • 16 September 2026

Other references


Access our resources on patching vulnerabilities