Open
Fix CVE-2026-40685: OOB heap write in JSON lookup #34
Fix CVE-2026-40685: OOB heap write in JSON lookup #34
Open
zhengdeAdd on May 5
Total: 2 files changed+56-1
@@ -0,0 +1,48 @@
1+--- a/src/string.c 2023-12-26 02:42:52.000000000 +0800
2++++ b/src/string.c 2026-05-05 21:38:50.229117757 +0800
3+@@ -606,17 +606,17 @@
4+ uschar * ss = yield = store_get(Ustrlen(s) + 1, GET_TAINTED); /* always treat as tainted */
5+ 
6+ while (*s)
7+- {
8+ if (*s != '\\')
9+ *ss++ = *s++;
10+- else if (isdigit(s[1]))
11+- {
12+- *ss++ = (s[1] - '0')*100 + (s[2] - '0')*10 + s[3] - '0';
13+- s += 4;
14++ else if (isdigit(*++s)) /* Apparently, musl libc dn_expand seen doing \\DD */
15++ { /* and \D also. We can only hope not when a real digit follows. */
16++ uschar c = *s++ - '0';
17++ if (isdigit(*s)) c = c * 10 + *s++ - '0';
18++ if (isdigit(*s)) c = c * 10 + *s++ - '0';
19++ *ss++ = c;
20+ }
21+ else if (*++s)
22+ *ss++ = *s++;
23+- }
24+ 
25+ *ss = 0;
26+ return yield;
27+@@ -928,7 +928,11 @@
28+ {
29+ if (*s == '<' && (ispunct(s[1]) || iscntrl(s[1])))
30+ {
31+- sep = s[1];
32++ if (!is_tainted(s))
33++ sep = s[1];
34++ else DEBUG(D_any)
35++ debug_printf("attempt to use tainted change-of-seperator spec (%s %d)\n",
36++ config_filename, config_lineno);
37+ if (*++s) ++s;
38+ while (isspace(*s) && *s != sep) s++;
39+ }
40+@@ -955,7 +959,7 @@
41+ die_tainted(US"string_nextinlist", func, line);
42+ for (; *s; s++)
43+ {
44+- if (*s == sep && (*(++s) != sep || sep_is_special)) break;
45++ if (*s == sep && (*++s != sep || sep_is_special)) break;
46+ if (p < buflen - 1) buffer[p++] = *s;
47+ }
48+ while (p > 0 && isspace(buffer[p-1])) p--;
@@ -4,7 +4,7 @@
4Summary: The exim mail transfer agent4Summary: The exim mail transfer agent
5Name: exim5Name: exim
6Version: 4.97.16Version: 4.97.1
7-Release: 27+Release: 3
8License: GPLv2+8License: GPLv2+
9Url: https://www.exim.org/9Url: https://www.exim.org/
10 10 
@@ -40,6 +40,7 @@ Patch1: exim-4.94-libdir.patch
40Patch2: exim-4.97-dlopen-localscan.patch40Patch2: exim-4.97-dlopen-localscan.patch
41Patch3: exim-4.96-pic.patch41Patch3: exim-4.96-pic.patch
42Patch4: CVE-2023-51766.patch42Patch4: CVE-2023-51766.patch
43+Patch5: CVE-2026-40685.patch
43 44 
44Requires: /etc/pki/tls/certs /etc/pki/tls/private45Requires: /etc/pki/tls/certs /etc/pki/tls/private
45Requires: setup46Requires: setup
@@ -480,6 +481,12 @@ fi
480%{_sysconfdir}/cron.daily/greylist-tidy.sh481%{_sysconfdir}/cron.daily/greylist-tidy.sh
481 482 
482%changelog483%changelog
484+* Tue May 05 2026 lizhengde <lizhengde@xfusion.com> - 4.97.1-3
485+- Type:CVE
486+- CVE:CVE-2026-40685
487+- SUG:NA
488+- DESC:fix CVE-2026-40685
489+ 
483* Tue Jul 9 2024 technology208 <technology@208suo.com> - 4.97-2490* Tue Jul 9 2024 technology208 <technology@208suo.com> - 4.97-2
484- Fix CVE-2023-51766491- Fix CVE-2023-51766
485 492