Cipher.update_into can corrupt memory if passed an immutable python object as the outbuf
Description
Published to the GitHub Advisory Database
Feb 7, 2023
Reviewed
Feb 7, 2023
Published by the National Vulnerability Database
Feb 7, 2023
Last updated
Nov 4, 2025
Previously,
Cipher.update_intowould 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. This is a soundness bug -- it allows programmers to misuse an API, it cannot be exploited by attacker controlled data alone.This now correctly raises an exception.
This issue has been present since
update_intowas originally introduced in cryptography 1.8.References