Forums / General Questions / PHPMailer Vulnerability ?

PHPMailer Vulnerability ?

Locked

Started by peekay on 17 Jun 2007, 10:04 PM · Views: 7,739

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
17 Jun 2007, 11:37 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: PHPMailer Vulnerability ?

It could only affect you IF ALL of the following are true:

  1. You're using Zen Cart v1.3.6, or v1.3.7

  2. You are using the "sendmail" or "Qmail" method for email-transport. (Default is PHP instead).

  3. You have allowed folks to edit your PHP files on your server and specifically alter the sendmail executable/binary path.

  4. You have a mis-formed "Email-From" address in your Admin->Configuration->Email Options or have allowed folks into your admin area so that they can set a rogue email address for the "email from" setting.

Even so, v1.3.8 will be altered to protect against the vulnerability in this integrated 3rd-party class.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Jun 2007, 10:24 AM
#3
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Re: PHPMailer Vulnerability ?

According to the advisory, there is a fix you can apply:

includes/classes/class.phpmailer.php

replace:

function SendmailSend($header, $body) {
        if ($this->Sender != "")
        $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender);
        else
        $sendmail = sprintf("%s -oi -t", $this->Sendmail);

with:

function SendmailSend($header, $body) {
         if ($this->Sender != "") {
         $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
         } else {
         $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
         }

Backup first, of course.

19 Jun 2007, 6:36 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: PHPMailer Vulnerability ?

Peekay:

According to the advisory, there is a fix you can apply
yes, thanks for pointing that out.
That fix will plug the vulnerability, and is incorporated into v1.3.8, as mentioned:
DrByte:

Even so, v1.3.8 will be altered to protect against the vulnerability in this integrated 3rd-party class.

However, it's important to note that the vulnerability is nearly impossible to trigger if using a default Zen Cart install.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Jun 2007, 7:15 PM
#5
peekay avatar

peekay

Zen Follower

Join Date:
Jun 2006
Location:
U.K.
Posts:
103
Plugin Contributions:
0

Re: PHPMailer Vulnerability ?

Thx DrByte. :smile: