Преглед на файлове

Fix insufficient sendmail command argument escaping (thanks to Mitchel Sahertian, Maor Shwartz and Dawid Golunski for bringing this to our attention). [CVE-2017-7692]

pdontthink преди 8 години
родител
ревизия
ff8f31441c
променени са 2 файла, в които са добавени 5 реда и са изтрити 3 реда
  1. 2 3
      class/deliver/Deliver_SendMail.class.php
  2. 3 0
      doc/ChangeLog

+ 2 - 3
class/deliver/Deliver_SendMail.class.php

@@ -106,11 +106,10 @@ class Deliver_SendMail extends Deliver {
         $rfc822_header = $message->rfc822_header;
         $rfc822_header = $message->rfc822_header;
         $from = $rfc822_header->from[0];
         $from = $rfc822_header->from[0];
         $envelopefrom = trim($from->mailbox.'@'.$from->host);
         $envelopefrom = trim($from->mailbox.'@'.$from->host);
-        $envelopefrom = str_replace(array("\0","\n"),array('',''),$envelopefrom);
         // save executed command for future reference
         // save executed command for future reference
-        $this->sendmail_command = "$sendmail_path $this->sendmail_args -f$envelopefrom";
+        $this->sendmail_command = escapeshellcmd("$sendmail_path $this->sendmail_args -f") . escapeshellarg($envelopefrom);
         // open process handle for writing
         // open process handle for writing
-        $stream = popen (escapeshellcmd($this->sendmail_command), "w");
+        $stream = popen($this->sendmail_command, "w");
         return $stream;
         return $stream;
     }
     }
 
 

+ 3 - 0
doc/ChangeLog

@@ -404,6 +404,9 @@ Version 1.5.2 - SVN
     the HELO host sent to the SMTP server when sending messages
     the HELO host sent to the SMTP server when sending messages
   - Added PDO support for database connections, so no external
   - Added PDO support for database connections, so no external
     database module needs to be installed
     database module needs to be installed
+  - Fixed insufficient sendmail command argument escaping (thanks
+    to Mitchel Sahertian, Maor Shwartz and Dawid Golunski for
+    bringing this to our attention). [CVE-2017-7692]
 
 
 Version 1.5.1 (branched on 2006-02-12)
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------
 --------------------------------------