SECURITY: fix Qualys CVE-2020-PFPSN
authorPhil Pennock <phil+git@pennock-tech.com>
Thu, 29 Oct 2020 23:00:51 +0000 (19:00 -0400)
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Thu, 27 May 2021 19:30:25 +0000 (21:30 +0200)
(cherry picked from commit 93b6044e1636404f3463f3e1113098742e295542)
(cherry picked from commit 4e59a5d5c448e1fcdcbead268ffe6561adf0224d)

doc/doc-txt/ChangeLog
src/src/parse.c

index ba9cc1c1221ea659751593911464f4c0102b4e1c..07fba9c23f8130343f48f8ea0e31e03b1b5cb031 100644 (file)
@@ -269,6 +269,10 @@ PP/03 Impose security length checks on various command-line options.
 PP/04 Fix Linux security issue CVE-2020-SLCWD and guard against PATH_MAX
       better.  Reported by Qualys.
 
+PP/05 Fix security issue CVE-2020-PFPSN and guard against cmdline invoker
+      providing a particularly obnoxious sender full name.
+      Reported by Qualys.
+
 
 Exim version 4.94
 -----------------
index 18a6df1987ba4d7457f7a2f41d978e4f057cdd50..7dfb9a7eb5f0e69774bcad94c7b4df4913251da0 100644 (file)
@@ -1129,9 +1129,17 @@ while (s < end)
             {
             if (ss >= end) ss--;
             *t++ = '(';
-            Ustrncpy(t, s, ss-s);
-            t += ss-s;
-            s = ss;
+            if (ss < s)
+              {
+              /* Someone has ended the string with "<punct>(". */
+              ss = s;
+              }
+            else
+              {
+              Ustrncpy(t, s, ss-s);
+              t += ss-s;
+              s = ss;
+              }
             }
           }