Version in base suite: 1.5.7+dfsg-1 Base version: libzstd_1.5.7+dfsg-1 Target version: libzstd_1.5.7+dfsg-1+deb13u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/libz/libzstd/libzstd_1.5.7+dfsg-1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/libz/libzstd/libzstd_1.5.7+dfsg-1+deb13u1.dsc changelog | 6 +++ patches/CVE-2026-124851.patch | 78 ++++++++++++++++++++++++++++++++++++++++++ patches/series | 1 3 files changed, 85 insertions(+) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpz30r5zp9/libzstd_1.5.7+dfsg-1.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpz30r5zp9/libzstd_1.5.7+dfsg-1+deb13u1.dsc: no acceptable signature found diff -Nru libzstd-1.5.7+dfsg/debian/changelog libzstd-1.5.7+dfsg/debian/changelog --- libzstd-1.5.7+dfsg/debian/changelog 2025-03-13 21:58:55.000000000 +0000 +++ libzstd-1.5.7+dfsg/debian/changelog 2026-11-24 16:46:38.000000000 +0000 @@ -1,3 +1,9 @@ +libzstd (1.5.7+dfsg-1+deb13u1) trixie-security; urgency=medium + + * CVE-2026-124851 + + -- Moritz Mühlenhoff Tue, 24 Nov 2026 18:43:52 +0100 + libzstd (1.5.7+dfsg-1) unstable; urgency=medium * Use debputy's X-Style: black. diff -Nru libzstd-1.5.7+dfsg/debian/patches/CVE-2026-124851.patch libzstd-1.5.7+dfsg/debian/patches/CVE-2026-124851.patch --- libzstd-1.5.7+dfsg/debian/patches/CVE-2026-124851.patch 1970-01-01 00:00:00.000000000 +0000 +++ libzstd-1.5.7+dfsg/debian/patches/CVE-2026-124851.patch 2026-11-24 16:48:32.000000000 +0000 @@ -0,0 +1,78 @@ +From 0c9d297531a9f15a717ff24604afc0843b3b1427 Mon Sep 17 00:00:00 2001 +From: Nick Terrell +Date: Fri, 6 Nov 2026 08:53:26 -0800 +Subject: [PATCH] decompress: prevent stale literal leaks after output buffer + wraps + +--- libzstd-1.5.7+dfsg.orig/lib/decompress/zstd_decompress_block.c ++++ libzstd-1.5.7+dfsg/lib/decompress/zstd_decompress_block.c +@@ -123,6 +123,25 @@ static void ZSTD_allocateLiteralsBuffer( + } + } + ++/** ++ * Zeros the bytes directly after the decompressed literals so that over-reads ++ * only read zeros, rather than potentially uninitialized memory, or bytes from ++ * prior decompressions. ++ */ ++static void ZSTD_zeroLiteralsBufferPadding(ZSTD_DCtx* dctx, size_t litSize) ++{ ++ if (dctx->litBufferLocation == ZSTD_split) { ++ BYTE* const litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE; ++ assert(litBufferEnd == dctx->litBufferEnd); ++ ZSTD_memset(litBufferEnd, 0, WILDCOPY_OVERLENGTH); ++ ZSTD_memset(dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE, 0, WILDCOPY_OVERLENGTH); ++ } else { ++ BYTE* const litBufferEnd = dctx->litBuffer + litSize; ++ assert(litBufferEnd == dctx->litBufferEnd); ++ ZSTD_memset(litBufferEnd, 0, WILDCOPY_OVERLENGTH); ++ } ++} ++ + /*! ZSTD_decodeLiteralsBlock() : + * Where it is possible to do so without being stomped by the output during decompression, the literals block will be stored + * in the dstBuffer. If there is room to do so, it will be stored in full in the excess dst space after where the current +@@ -240,6 +259,7 @@ static size_t ZSTD_decodeLiteralsBlock(Z + + RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, ""); + ++ ZSTD_zeroLiteralsBufferPadding(dctx, litSize); + dctx->litPtr = dctx->litBuffer; + dctx->litSize = litSize; + dctx->litEntropy = 1; +@@ -283,6 +303,7 @@ static size_t ZSTD_decodeLiteralsBlock(Z + { + ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize); + } ++ ZSTD_zeroLiteralsBufferPadding(dctx, litSize); + dctx->litPtr = dctx->litBuffer; + dctx->litSize = litSize; + return lhSize+litSize; +@@ -329,6 +350,7 @@ static size_t ZSTD_decodeLiteralsBlock(Z + { + ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize); + } ++ ZSTD_zeroLiteralsBufferPadding(dctx, litSize); + dctx->litPtr = dctx->litBuffer; + dctx->litSize = litSize; + return lhSize+1; +@@ -2183,6 +2205,19 @@ void ZSTD_checkContinuity(ZSTD_DCtx* dct + dctx->prefixStart = dst; + dctx->previousDstEnd = dst; + } ++ /* The external dictionary and current prefix share the frame window. ++ * As the prefix grows after a wrap, retaining a full external window ++ * could let corrupt offsets alias the destination and expose stale literals. ++ * decodedSize > 0 ensures the frame header has initialized windowSize. ++ * Only kicks in after decoding windowSize bytes because the entire dictionary is ++ * valid as long as a single byte of the dictionary is in the window. ++ */ ++ if (dstSize > 0 && dctx->isFrameDecompression && dctx->decodedSize > 0 && dctx->decodedSize >= dctx->fParams.windowSize) { ++ size_t const prefixSize = (size_t)((const char*)dctx->previousDstEnd - (const char*)dctx->prefixStart); ++ size_t const extDictSize = (size_t)((const char*)dctx->prefixStart - (const char*)dctx->virtualStart); ++ U64 const maxExtDictSize = prefixSize < dctx->fParams.windowSize ? dctx->fParams.windowSize - prefixSize : 0; ++ dctx->virtualStart = (const char*)dctx->prefixStart - (size_t)MIN((U64)extDictSize, maxExtDictSize); ++ } + } + + diff -Nru libzstd-1.5.7+dfsg/debian/patches/series libzstd-1.5.7+dfsg/debian/patches/series --- libzstd-1.5.7+dfsg/debian/patches/series 2025-02-24 12:35:38.000000000 +0000 +++ libzstd-1.5.7+dfsg/debian/patches/series 2026-11-24 16:48:22.000000000 +0000 @@ -8,3 +8,4 @@ 0022-tests-timeout.patch 0023-cmake-min-3.13.patch 0024-no-lessopen-test.patch +CVE-2026-124851.patch