]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix heap buffer overflow in BIO_f_linebuffer
authorNeil Horman <nhorman@openssl.org>
Wed, 7 Jan 2026 16:52:09 +0000 (11:52 -0500)
committerTomas Mraz <tomas@openssl.org>
Mon, 26 Jan 2026 19:42:50 +0000 (20:42 +0100)
commit475c466ef2fbd8fc1df6fae1c3eed9c813fc8ff6
treeccae3428d14a25f3ded320c72e62b11d33c996e4
parente0666f72294691a808443970b654412a6d92fa0f
Fix heap buffer overflow in BIO_f_linebuffer

When a FIO_f_linebuffer is part of a bio chain, and the next BIO
preforms short writes, the remainder of the unwritten buffer is copied
unconditionally to the internal buffer ctx->obuf, which may not be
sufficiently sized to handle the remaining data, resulting in a buffer
overflow.

Fix it by only copying data when ctx->obuf has space, flushing to the
next BIO to increase available storage if needed.

Fixes openssl/srt#48

Fixes CVE-2025-68160

Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Mon Jan 26 19:41:40 2026
(cherry picked from commit b21663c35a6f0ed4c8de06855bdc7a6a21f00c2f)
crypto/bio/bf_lbuf.c