On Tue, Aug 25, 2026 at 07:11:24PM +0200, [email protected] wrote:
F: 1 OK CAPABILITY completed.
Logging in...
Fatal: buffer too small. Please report a bug.
#6 0x0000aaaaaaab2ee8 in imap_exec (ctx=0xaaaaaaaf5af0,
cmdp=0xaaaaaacadbb0, done=<optimized out>,
fmt=<optimized out>) at drv_imap.c:539
#7 0x0000aaaaaaaaf0cc in done_imap_cmd (ctx=0xaaaaaaaf5af0,
cmd=0xaaaaaacadc80,
response=<optimized out>) at drv_imap.c:359
the call chain was obviously tail-merged, making this trace kinda
useless.
however, the only place where this is actually possible is the LOGIN
path, and thus the AUTH=PLAIN thing must be a red herring.
please try the attached patch.
From c885c5c946d739af958d6705983ace9c73f18383 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <[email protected]>
Date: Thu, 27 Aug 2026 19:37:47 +0200
Subject: [PATCH] limit length of credentials supplied to LOGIN
xvprintf_core() uses its internal fixed-size buffer when quoting
strings, so we should limit what we feed it.
this prevents that a build without SASL support oob()'s when fed
credentials meant for XOAUTH2.
REFMAIL: [email protected]
---
src/drv_imap.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/drv_imap.c b/src/drv_imap.c
index 9b170ab..61a79d5 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -2682,6 +2682,11 @@ imap_open_store_authenticate2( imap_store_t *ctx )
if (auth_login) {
if (!ensure_user( srvc ) || !ensure_password( srvc ))
goto bail;
+ // Strictly speaking, the limit is util.c:QPRINTF_BUFF / 2
+ if (strlen( srvc->user ) + strlen( srvc->pass ) > 200) {
+ error( "IMAP error: LOGIN credentials are excessively long. Wrong AuthMech selected?\n" );
+ goto bail;
+ }
#ifdef HAVE_LIBSSL
if (!ctx->conn.ssl && !ctx->conn.conf->tunnel)
#endif
--
2.55.0.617.g32b4de65e6
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel