aboutsummaryrefslogtreecommitdiffstats
path: root/community/exim/CVE-2020-12783-2.patch
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2020-05-22 12:23:50 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2020-05-22 12:27:13 +0000
commit6f89c26c7c10bb7f77e391510cc1d57f8881abbc (patch)
tree6b7af53e5277911b3cc2436949b4ee5ae8e33310 /community/exim/CVE-2020-12783-2.patch
parent25fe34656b9e14d6e4e67944f178c6687c95c901 (diff)
community/exim: security fix (CVE-2020-12783)
fixes #11556
Diffstat (limited to 'community/exim/CVE-2020-12783-2.patch')
-rw-r--r--community/exim/CVE-2020-12783-2.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/community/exim/CVE-2020-12783-2.patch b/community/exim/CVE-2020-12783-2.patch
new file mode 100644
index 00000000000..7f1e825d95c
--- /dev/null
+++ b/community/exim/CVE-2020-12783-2.patch
@@ -0,0 +1,59 @@
+From 5a41d2c2cd2b28a0d1aea21edeaea02bd6db4984 Mon Sep 17 00:00:00 2001
+From: Jeremy Harris <jgh146exb@wizmail.org>
+Date: Wed, 6 May 2020 22:31:25 +0100
+Subject: [PATCH 45/46] Rework SPA fix to avoid overflows. Bug 2571
+
+Amends: 6a7edbf660
+(cherry picked from commit a04174dc2a84ae1008c23b6a7109e7fa3fb7b8b0)
+---
+ src/auths/spa.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/src/auths/spa.c b/src/auths/spa.c
+index ed9aff23b..4e3aef808 100644
+--- a/src/auths/spa.c
++++ b/src/auths/spa.c
+@@ -140,6 +140,7 @@ SPAAuthResponse response;
+ SPAAuthResponse *responseptr = &response;
+ uschar msgbuf[2048];
+ uschar *clearpass, *s;
++unsigned off;
+
+ /* send a 334, MS Exchange style, and grab the client's request,
+ unless we already have it via an initial response. */
+@@ -194,10 +195,13 @@ that causes failure if the size of msgbuf is exceeded. ****/
+
+ {
+ int i;
+- char *p = ((char*)responseptr) + IVAL(&responseptr->uUser.offset,0);
++ char * p;
+ int len = SVAL(&responseptr->uUser.len,0)/2;
+
+- if (p + len*2 >= CS (responseptr+1))
++ if ( (off = IVAL(&responseptr->uUser.offset,0)) >= sizeof(SPAAuthResponse)
++ || len >= sizeof(responseptr->buffer)/2
++ || (p = (CS responseptr) + off) + len*2 >= CS (responseptr+1)
++ )
+ {
+ DEBUG(D_auth)
+ debug_printf("auth_spa_server(): bad uUser spec in response\n");
+@@ -252,13 +256,14 @@ spa_smb_nt_encrypt (clearpass, challenge.challengeData, ntRespData);
+
+ /* compare NT hash (LM may not be available) */
+
+-s = (US responseptr) + IVAL(&responseptr->ntResponse.offset,0);
+-if (s + 24 >= US (responseptr+1))
++off = IVAL(&responseptr->ntResponse.offset,0);
++if (off >= sizeof(SPAAuthResponse) - 24)
+ {
+ DEBUG(D_auth)
+ debug_printf("auth_spa_server(): bad ntRespData spec in response\n");
+ return FAIL;
+ }
++s = (US responseptr) + off;
+
+ if (memcmp(ntRespData, s, 24) == 0)
+ return auth_check_serv_cond(ablock); /* success. we have a winner. */
+--
+2.26.2
+