]> git.ipfire.org Git - thirdparty/qemu.git/commit
ui/vnc-clipboard: fix infinite loop in inflate_buffer (CVE-2023-3255)
authorMauro Matteo Cascella <mcascell@redhat.com>
Tue, 4 Jul 2023 08:41:22 +0000 (10:41 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 31 Jul 2023 05:52:38 +0000 (08:52 +0300)
commit35720b3d90866ed4c174eb35762e04a1b9e533d1
tree9e9c0f89a9a81b91489b2b976880f5e46ec0fe1b
parentd1063b6551b5f034b6f1f18419af764a85c77a1e
ui/vnc-clipboard: fix infinite loop in inflate_buffer (CVE-2023-3255)

A wrong exit condition may lead to an infinite loop when inflating a
valid zlib buffer containing some extra bytes in the `inflate_buffer`
function. The bug only occurs post-authentication. Return the buffer
immediately if the end of the compressed data has been reached
(Z_STREAM_END).

Fixes: CVE-2023-3255
Fixes: 0bf41cab ("ui/vnc: clipboard support")
Reported-by: Kevin Denis <kevin.denis@synacktiv.com>
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230704084210.101822-1-mcascell@redhat.com>
(cherry picked from commit d921fea338c1059a27ce7b75309d7a2e485f710b)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
ui/vnc-clipboard.c