Version in base suite: 0.14.0-4 Base version: libstrophe_0.14.0-4 Target version: libstrophe_0.14.0-4+deb13u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/libs/libstrophe/libstrophe_0.14.0-4.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/libs/libstrophe/libstrophe_0.14.0-4+deb13u1.dsc changelog | 9 patches/0002-Fix-SASL-CVE-2026-112063.patch | 264 ++++++++++++++++++++++++++++ patches/series | 1 3 files changed, 274 insertions(+) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmp42adg9hi/libstrophe_0.14.0-4.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmp42adg9hi/libstrophe_0.14.0-4+deb13u1.dsc: no acceptable signature found diff -Nru libstrophe-0.14.0/debian/changelog libstrophe-0.14.0/debian/changelog --- libstrophe-0.14.0/debian/changelog 2025-03-20 19:51:16.000000000 +0000 +++ libstrophe-0.14.0/debian/changelog 2026-11-17 19:50:42.000000000 +0000 @@ -1,3 +1,12 @@ +libstrophe (0.14.0-4+deb13u1) trixie; urgency=medium + + * Team upload + * d/patches: + Add 0002-Fix-SASL-CVE-2026-112063.patch + Fixes stack buffer overflow on oversized SCRAM, i.e. CVE-2026-112063 + + -- Martin Tue, 17 Nov 2026 19:50:42 +0000 + libstrophe (0.14.0-4) unstable; urgency=medium * Add Breaks/Replaces in libstrophe-doc (Closes: #1100944) diff -Nru libstrophe-0.14.0/debian/patches/0002-Fix-SASL-CVE-2026-112063.patch libstrophe-0.14.0/debian/patches/0002-Fix-SASL-CVE-2026-112063.patch --- libstrophe-0.14.0/debian/patches/0002-Fix-SASL-CVE-2026-112063.patch 1970-01-01 00:00:00.000000000 +0000 +++ libstrophe-0.14.0/debian/patches/0002-Fix-SASL-CVE-2026-112063.patch 2026-11-17 19:50:42.000000000 +0000 @@ -0,0 +1,264 @@ +From 252ec0208eb9a0d077afcc53351fca99e2efe81f Mon Sep 17 00:00:00 2001 +From: Bohdan +Date: Thu, 12 Nov 2026 13:27:41 +0200 +Subject: [PATCH] Fix stack buffer overflow on oversized SCRAM salt + +SCRAM_Hi() copies the salt into a 128 byte buffer on the stack and +appends INT(1) to it, so it can only handle salts of up to 124 bytes. +That limit was only enforced by an assert(), which is compiled out as +soon as NDEBUG is defined. + +The salt isn't under our control though. It is taken verbatim from the +'s=' attribute of the server-first-message, base64-decoded by +sasl_scram() without any limit on the resulting length, and passed down +to SCRAM_Hi() through SCRAM_ClientKey(). A malicious server can +therefore send an 's=' attribute that decodes to more than 124 bytes and +overflow the stack frame of SCRAM_Hi(), which aborts the client in debug +builds and silently corrupts the stack otherwise. + +Turn the assert() into a runtime check and propagate the failure through +SCRAM_ClientKey() up to sasl_scram(), which already aborts the +authentication when it can't compute a response. + +This is CVE-2026-112063. + +Reproduced with a 125 byte salt in an NDEBUG build under ASan, before +the fix: + + ERROR: AddressSanitizer: stack-buffer-overflow + WRITE of size 4 ... + #1 SCRAM_Hi scram.c:189 + #2 SCRAM_ClientKey scram.c:215 + #3 sasl_scram sasl.c:457 + +Fixes: ea719cd02ac1 ("SCRAM-SHA-1 authentication mechanism support") +Signed-off-by: Bohdan +Acked-by: Steffen Jaeckel +--- + src/sasl.c | 7 ++++-- + src/scram.c | 60 +++++++++++++++++++++++++++++----------------- + src/scram.h | 19 +++++++++------ + tests/test_scram.c | 51 ++++++++++++++++++++++++++++++++++----- + 4 files changed, 100 insertions(+), 37 deletions(-) + +--- a/src/sasl.c ++++ b/src/sasl.c +@@ -454,8 +454,11 @@ + goto out_auth; + } + +- SCRAM_ClientKey(alg, (uint8_t *)password, strlen(password), (uint8_t *)sval, +- sval_len, (uint32_t)ival, key); ++ if (SCRAM_ClientKey(alg, (uint8_t *)password, strlen(password), ++ (uint8_t *)sval, sval_len, (uint32_t)ival, key) != 0) { ++ strophe_error(ctx, "SASL", "can't process the salt sent by the server"); ++ goto out_auth; ++ } + SCRAM_ClientSignature(alg, key, (uint8_t *)auth, strlen(auth), sign); + SCRAM_ClientProof(alg, key, sign, sign); + +--- a/src/scram.c ++++ b/src/scram.c +@@ -30,6 +30,11 @@ + + #define HMAC_BLOCK_SIZE_MAX 128 + ++/* Maximum length of a salt SCRAM_Hi() can process. The salt is concatenated ++ * with INT(1) into a buffer on the stack, see SCRAM_Hi(). ++ */ ++#define SCRAM_SALT_MAX 124 ++ + static const uint8_t ipad = 0x36; + static const uint8_t opad = 0x5C; + +@@ -163,26 +168,31 @@ + alg->final((void *)&ctx, digest); + } + +-static void SCRAM_Hi(const struct hash_alg *alg, +- const uint8_t *text, +- size_t len, +- const uint8_t *salt, +- size_t salt_len, +- uint32_t i, +- uint8_t *digest) ++static int SCRAM_Hi(const struct hash_alg *alg, ++ const uint8_t *text, ++ size_t len, ++ const uint8_t *salt, ++ size_t salt_len, ++ uint32_t i, ++ uint8_t *digest) + { ++ static uint8_t int1[] = {0x0, 0x0, 0x0, 0x1}; ++ + size_t k; + uint32_t j; +- uint8_t tmp[128]; +- +- static uint8_t int1[] = {0x0, 0x0, 0x0, 0x1}; ++ uint8_t tmp[SCRAM_SALT_MAX + sizeof(int1)]; + +- /* assume salt + INT(1) isn't longer than sizeof(tmp) */ +- assert(salt_len <= sizeof(tmp) - sizeof(int1)); ++ /* The salt is attacker-controlled, it comes from the 's=' attribute of ++ * the server-first-message, therefore this has to be checked at runtime ++ * instead of with assert(). ++ */ ++ if (salt_len > SCRAM_SALT_MAX) { ++ return -1; ++ } + + memset(digest, 0, alg->digest_size); + if (i == 0) { +- return; ++ return 0; + } + + memcpy(tmp, salt, salt_len); +@@ -198,23 +208,29 @@ + digest[k] ^= tmp[k]; + } + } ++ ++ return 0; + } + +-void SCRAM_ClientKey(const struct hash_alg *alg, +- const uint8_t *password, +- size_t len, +- const uint8_t *salt, +- size_t salt_len, +- uint32_t i, +- uint8_t *key) ++int SCRAM_ClientKey(const struct hash_alg *alg, ++ const uint8_t *password, ++ size_t len, ++ const uint8_t *salt, ++ size_t salt_len, ++ uint32_t i, ++ uint8_t *key) + { + uint8_t salted[SCRAM_DIGEST_SIZE]; + + /* XXX: Normalize(password) is omitted */ + +- SCRAM_Hi(alg, password, len, salt, salt_len, i, salted); ++ if (SCRAM_Hi(alg, password, len, salt, salt_len, i, salted) != 0) { ++ return -1; ++ } + crypto_HMAC(alg, salted, alg->digest_size, (uint8_t *)"Client Key", + strlen("Client Key"), key); ++ ++ return 0; + } + + void SCRAM_ClientSignature(const struct hash_alg *alg, +--- a/src/scram.h ++++ b/src/scram.h +@@ -37,13 +37,18 @@ + extern const struct hash_alg *scram_algs[]; + extern const size_t scram_algs_num; + +-void SCRAM_ClientKey(const struct hash_alg *alg, +- const uint8_t *password, +- size_t len, +- const uint8_t *salt, +- size_t salt_len, +- uint32_t i, +- uint8_t *key); ++/** Compute the SCRAM ClientKey. ++ * ++ * @return 0 on success, -1 if the salt is too long to be processed. 'key' is ++ * left untouched in the error case. ++ */ ++int SCRAM_ClientKey(const struct hash_alg *alg, ++ const uint8_t *password, ++ size_t len, ++ const uint8_t *salt, ++ size_t salt_len, ++ uint32_t i, ++ uint8_t *key); + + void SCRAM_ClientSignature(const struct hash_alg *alg, + const uint8_t *ClientKey, +--- a/tests/test_scram.c ++++ b/tests/test_scram.c +@@ -68,15 +68,51 @@ + printf("Derivation function SCRAM_Hi tests for %s.\n", alg->scram_name); + for (i = 0; i < ARRAY_SIZE(df_vectors); ++i) { + printf("Test #%d: ", (int)i + 1); +- SCRAM_Hi(alg, (uint8_t *)df_vectors[i].P, df_vectors[i].P_len, +- (uint8_t *)df_vectors[i].S, df_vectors[i].S_len, +- df_vectors[i].c, dk); ++ ENSURE_EQ(0, SCRAM_Hi(alg, (uint8_t *)df_vectors[i].P, ++ df_vectors[i].P_len, (uint8_t *)df_vectors[i].S, ++ df_vectors[i].S_len, df_vectors[i].c, dk)); + s = test_bin_to_hex(dk, alg->digest_size); + COMPARE(df_vectors[i].DK, s); + printf("ok\n"); + } + } + ++/* ++ * CVE-2026-112063: a malicious server could send a 's=' attribute in its ++ * server-first-message that decodes to a salt longer than the buffer ++ * SCRAM_Hi() concatenates it into. An oversized salt has to be rejected ++ * instead of overflowing that buffer. ++ */ ++static const struct { ++ size_t salt_len; ++ int rc; ++} salt_vectors[] = { ++ {SCRAM_SALT_MAX, 0}, ++ {SCRAM_SALT_MAX + 1, -1}, ++}; ++ ++static void test_salt_len(const struct hash_alg *alg) ++{ ++ size_t i; ++ uint8_t salt[SCRAM_SALT_MAX + 1]; ++ uint8_t dk[SCRAM_DIGEST_SIZE]; ++ uint8_t key[SCRAM_DIGEST_SIZE]; ++ ++ printf("Salt length tests for %s.\n", alg->scram_name); ++ memset(salt, 'A', sizeof(salt)); ++ for (i = 0; i < ARRAY_SIZE(salt_vectors); ++i) { ++ printf("Test #%d: ", (int)i + 1); ++ ENSURE_EQ(salt_vectors[i].rc, ++ SCRAM_Hi(alg, (uint8_t *)"password", 8, salt, ++ salt_vectors[i].salt_len, 1, dk)); ++ /* the result has to be propagated to the caller */ ++ ENSURE_EQ(salt_vectors[i].rc, ++ SCRAM_ClientKey(alg, (uint8_t *)"password", 8, salt, ++ salt_vectors[i].salt_len, 1, key)); ++ printf("ok\n"); ++ } ++} ++ + /* RFC6120 */ + static const struct { + char *password; +@@ -121,9 +157,9 @@ + scram_vectors[i].challenge, scram_vectors[i].response); + test_hex_to_bin(scram_vectors[i].salt, salt, &salt_len); + +- SCRAM_ClientKey(alg, (uint8_t *)scram_vectors[i].password, +- strlen(scram_vectors[i].password), salt, salt_len, +- scram_vectors[i].i, key); ++ ENSURE_EQ(0, SCRAM_ClientKey(alg, (uint8_t *)scram_vectors[i].password, ++ strlen(scram_vectors[i].password), salt, ++ salt_len, scram_vectors[i].i, key)); + SCRAM_ClientSignature(alg, key, (uint8_t *)auth, strlen(auth), sign); + for (j = 0; j < alg->digest_size; j++) { + sign[j] ^= key[j]; +@@ -207,6 +243,9 @@ + int main() + { + test_df(&scram_sha1); ++ test_salt_len(&scram_sha1); ++ test_salt_len(&scram_sha256); ++ test_salt_len(&scram_sha512); + test_scram(&scram_sha1); + test_hmac(&scram_sha1); + test_hmac(&scram_sha256); diff -Nru libstrophe-0.14.0/debian/patches/series libstrophe-0.14.0/debian/patches/series --- libstrophe-0.14.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ libstrophe-0.14.0/debian/patches/series 2026-11-17 19:50:42.000000000 +0000 @@ -0,0 +1 @@ +0002-Fix-SASL-CVE-2026-112063.patch