Description
bz2.BZ2Decompressor objects could be reused after a decompression error. If an application caught the resulting OSError and retried with the same decompressor, crafted input could cause the decompressor to resume from an invalid internal state and perform out-of-bounds writes to a stack buffer. This could crash the process when processing untrusted data.
Problem types
CWE-121 Stack-based buffer overflow
Product status
Any version before 3.16.0
Credits
Bitshift (https://github.com/TheShiftedBit)
Emma Smith (https://github.com/emmatyping)
Stan Ulbrych (https://github.com/StanFromIreland)
Serhiy Storchaka (https://github.com/serhiy-storchaka)
References
www.openwall.com/lists/oss-security/2026/06/08/17
github.com/python/cpython/pull/150600
mail.python.org/.../thread/DBJZETMGUIFK7DVUWMOXHD3Z6IX2QPSX/
github.com/python/cpython/issues/150599