Changeset 752

Show
Ignore:
Timestamp:
01/21/08 15:33:15 (11 months ago)
Author:
laurentj
Message:

fixed bug #437: a vulnerability in phpmailer/jmailer

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.x/lib/jelix/utils/jMailer.class.php

    r713 r752  
    405405    protected function SendmailSend($header, $body) { 
    406406        if ($this->Sender != "") 
    407             $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender); 
     407            $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); 
    408408        else 
    409             $sendmail = sprintf("%s -oi -t", $this->Sendmail); 
     409            $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); 
    410410 
    411411        if(!@$mail = popen($sendmail, "w")) 
  • branches/1.0.x/lib/jelix/utils/jMailer.class.php

    r713 r752  
    405405    protected function SendmailSend($header, $body) { 
    406406        if ($this->Sender != "") 
    407             $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender); 
     407            $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); 
    408408        else 
    409             $sendmail = sprintf("%s -oi -t", $this->Sendmail); 
     409            $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); 
    410410 
    411411        if(!@$mail = popen($sendmail, "w")) 
  • branches/1.0.x/lib/jelix/utils/jMailer.class.php

    r713 r752  
    405405    protected function SendmailSend($header, $body) { 
    406406        if ($this->Sender != "") 
    407             $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender); 
     407            $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); 
    408408        else 
    409             $sendmail = sprintf("%s -oi -t", $this->Sendmail); 
     409            $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); 
    410410 
    411411        if(!@$mail = popen($sendmail, "w")) 
  • trunk/lib/jelix/utils/jMailer.class.php

    r713 r752  
    405405    protected function SendmailSend($header, $body) { 
    406406        if ($this->Sender != "") 
    407             $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender); 
     407            $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); 
    408408        else 
    409             $sendmail = sprintf("%s -oi -t", $this->Sendmail); 
     409            $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); 
    410410 
    411411        if(!@$mail = popen($sendmail, "w")) 
  • trunk/lib/jelix/utils/jMailer.class.php

    r713 r752  
    405405    protected function SendmailSend($header, $body) { 
    406406        if ($this->Sender != "") 
    407             $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender); 
     407            $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); 
    408408        else 
    409             $sendmail = sprintf("%s -oi -t", $this->Sendmail); 
     409            $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); 
    410410 
    411411        if(!@$mail = popen($sendmail, "w")) 
  • trunk/lib/jelix/utils/jMailer.class.php

    r713 r752  
    405405    protected function SendmailSend($header, $body) { 
    406406        if ($this->Sender != "") 
    407             $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender); 
     407            $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); 
    408408        else 
    409             $sendmail = sprintf("%s -oi -t", $this->Sendmail); 
     409            $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); 
    410410 
    411411        if(!@$mail = popen($sendmail, "w")) 
Download in other formats: Unified Diff Zip Archive