A corrective release of the Exim mail server 4.100.2 has been published, addressing a vulnerability (CVE not assigned) that leads to a buffer overflow when decoding specially formatted headers. Exploitation of this vulnerability for remote code execution with root privileges cannot be ruled out. The issue occurs starting with version Exim 4.100.
No details are provided, but judging by the fix, the issue is caused by incorrect buffer size calculation during normalization of specially formatted multi-line headers containing line feed characters "\n". If the character "\n" is not the last one and is not followed by a space, a buffer one byte smaller than the actual size of the string is created, causing the string tail to overwrite the subsequent structure in memory. -if (!Ustrchr(s, ‘\n’)) return s; -yield = t = store_get(Ustrlen(s), s); +if ((t = Ustrchr(s, ‘\0’)) == s) return s; +if (!(u = Ustrchr(s, ‘\n’)) || u+1 == t) return s; + +yield = t = store_get(t — s, s); \/* yield will be shorter than input *\/ while(*s) — if (*s == ‘\n’) while (isspace(*++s)) ; — else *t++ = *s++; + if (*s == ‘\n’ && isspace(s[1])) + { while (isspace(*++s)) ; *t++ = ‘ ‘; } + else + *t++ = *s++;
Source: opennet.ru
