Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / "There was a security error when trying to login" - v1.3.8

"There was a security error when trying to login" - v1.3.8

Views: 96,061

Results 101 to 120 of 140
26 Jun 2008, 8:58 AM
#101
elliesupport avatar

elliesupport

New Zenner

Join Date:
Jun 2008
Posts:
4
Plugin Contributions:
0

"There was a security error when trying to login" - v1.3.8

kuroi:

The hosting company won't be able to help you. The template clearly hasn't been written for the current version of Zen Cart. However, this thread should contain all the information that you need to solve the problem, so it's most likely a problem with the way in which you have made the changes, but we'd need more information about your template and how precisely your have made the changes to help your further.

I uploaded the zc_install folder again and successfully upgraded the database from 1.3.6 to 1.3.7 but when i try to upgrade from 1.3.7 to 1.3.8 i get another error


1062 Duplicate entry 'Customers who have never completed a purchase' for key 2
in:
[INSERT INTO ataste_query_builder (query_category, query_name, query_description , query_string) VALUES ('email,newsletters', 'Customers who have never completed a purchase', 'For sending newsletter to all customers who registered but have never completed a purchase', 'SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL');]


The site now has "Your database appears to need patching to a higher level. See Tools->Server Information to review patch levels." so I checked the Tools -> Server info and yes it tells me its at 1.3.7

any ideas how to get it to upgrade again?

Many thanks
Ellie

26 Jun 2008, 9:18 AM
#102
elliesupport avatar

elliesupport

New Zenner

Join Date:
Jun 2008
Posts:
4
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

i went back in to the zc_install and ran the install, It tells me that the database appears to be version 1.3.8 already so that my explain the "duplicate"!

But on the site it still tell me i might need a patch !

grr!

Ellie

27 Jun 2008, 1:02 AM
#103
dscvry avatar

dscvry

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
20
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

! Another phenomenon but different for login-gremlin pros ... for both customer and admin logins, only the very first attempt with correct data input is bringing up the message 'There was a security error while trying to login'. The password asterisks stay in place, and simply tapping return once more
then gets you in to the store/admin with apparently full functionality. After this first occurrence, admin and any successive (test) customers can log in & out as much as they wish without further issues until (I assume) the session gets terminated (i.e. by navigating elsewhere before returning to the zensite URL), and the one-off glitch pops up again. Clearing the cache doesn't provoke the security message.

Version Zencart is 1.3.8, on apache (unix) with php 5.2.5, MySQL 4.1.22, using shared certificate SSL applied to both admin and store (which is when the glitches showed). I've switched database referents to a prior populated database (also generation 1.3.8), and checked the obvious here - the database fields are all present & correct - but an attempted reinstallation to apply the SSL choked on a blank database update page.

Config files are consistent AFAICT with each other & the SSL config. Having checked some threads on login probs, I've verified that the upgraded session security token codings are present in the following files

tpl_timeout_default.php
tpl_login_default.php
admin/login.php

and that the customised files replicate the updated templates for the first two. Sessions.php is version $id 6662 2007-08-12 21:37:17Z wilt$; the fault recurs at each new session event so seems related to dedicated session variables somehow. Also noted that there was a php 5.2 patch pasted into the code ...

Switching to classic template did not stop login snagging; changing databases does not avoid it either.

Attempting diy diagnosis using the admin-developer toolkit search, the error message ERROR_SECURITY_ERROR is generated only when the following trap is triggered in either the modules/pages/login/ or modules/pages/time_out/header_php.php files

$_SESSION['securityToken']!==$_POST['securityToken']

which (I think) is saying 'if the posted encryption string does not match the generated key (then slap up the security error slogan). What might make these fall out with each other just once ? Is this likely to be a shared-SSL or database access issue ? There's no customisation applied to admin, very little to catalog. Any light shed on what's going awry would be much appreciated, TIA

1 Jul 2008, 11:01 AM
#104
dscvry avatar

dscvry

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
20
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

Well, that's a conversation killer, 8-| !! What happened next, was: an anomaly between some legacy HTML-frame coding and the shared SSL cert links needed sorting out ... and after this, the snagging disappeared for the catalog (i.e. for test customers using the store), at least as a predictable recurring event. It has come back for old time's sake here and there, but it looks to have been resolved by clearing out the frames. As for the admin pages, snagging is still there. Not for us to question why sometimes ...

23 Oct 2008, 5:22 PM
#105
tecbrat avatar

tecbrat

Zen Follower

Join Date:
Feb 2005
Posts:
239
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

I didn't read every message in this thread, so if I am repeating someone, sorry.

I just wanted to add that this situation also came up when using a commercial template that had it's own copy of tpl_login_default.php.

The same solution applies.

25 Oct 2008, 12:57 AM
#106
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Location:
Northwest Connecticut
Posts:
87
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

I was getting this error can came to the forum and have corrected it by reading through all of this, a couple of the posts explain very well what lines were missing in tbl_login_default.php but what I don't understand is the zen cart i am working on is not an upgrade it is a complete new install at v1.3.8, so why was I getting this error? I hadn't customized tbl_login_default.php but now it is customized with the lines that were missing and should have been there...

24 Nov 2008, 8:06 PM
#107
travellers avatar

travellers

Zen Follower

Join Date:
Oct 2008
Posts:
143
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

I've just started experiencing this error today, but I reckon I know the cause - today I installed GooglePayments, and two of the files that mod replaced were "- /includes/templates/YOUR_TEMPLATE/templates/tpl_login_default.php" and "- /includes/templates/YOUR_TEMPLATE/templates/tpl_timeout_default.php".

Obviously I cant simply reinstate those two files from my most recent backup as presumably the changes in them are required by GooglePayments, so can anyone summarise the bit that the mod has apparently not included in the mod? While we're at it, is it possible for someone to change the files in the download (I got it from here just a couple of hours ago) or failing that to put an addendum on the mod download page that alerts downloaders about the changes they'll need to make?

Help much appreciated - I cant get any customer login to work at the moment!!!

24 Nov 2008, 8:41 PM
#108
travellers avatar

travellers

Zen Follower

Join Date:
Oct 2008
Posts:
143
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

S'okay, I found it on the previous page (post 98 for those looking!).

I'm **still **confused as to why the download of the Google Payments mod still has the **old **files though!

30 Mar 2009, 12:58 AM
#109
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

edit: nevermind, I'm getting a different error, will create a new thread

30 Mar 2009, 8:05 PM
#110
atticus avatar

atticus

New Zenner

Join Date:
Nov 2007
Posts:
3
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

I am new to Zen Cart. I just did a fresh install of 1.3.8. Actually, Godaddy did it on a shared hosting account.

Can't login to admin or customer account. Get a "Security blah blah blah message" on the customer account.

When I try to resend the password for the admin account it appears to do nothing.

I have tried different browsers and they are all set to receive cookies.

I have read through all of these forums posts and I do not know why a fresh copy of zen cart 1.3.8 would be having these issues.

Any suggestions on resolving this matter?

3 Apr 2009, 7:52 AM
#111
dscvry avatar

dscvry

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
20
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

Atticus - does this describe the phenomenon:
"... for both customer and admin logins, only the very first attempt with correct data input is bringing up the message 'There was a security error while trying to login'. The password asterisks stay in place, and simply tapping return once more then gets you in to the store/admin with apparently full functionality."
Not sure why that happens, but it can be lived with if so ... (dscvry post above fr June 2008) - sweet if that's the issue.

15 Apr 2009, 3:03 PM
#112
dannylex avatar

dannylex

New Zenner

Join Date:
Apr 2009
Posts:
1
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

DrByte:

It has nothing to do with 644 or 444 on your configure.php files.

Whatever is causing it is preventing your visitors from being able to establish a PHP session. You can't even add anything to the cart and have it be remembered. That's a classic problem with sessions.

When did your hosting company upgrade to PHP 5.2.5? Maybe they busted this on you without knowing it.

I'm having the same problem that crisand, I'm not using a webhosting since i have control over the host myself, i think i have a problem with sessions too, but i have tried to stablish a php session between 2 pages for testing and it works fine, besides the admin works fine too.

Please I need your help urgent, i don't know what to do.

I have SSL in false, but i do have a certified installed.

27 Apr 2009, 8:01 PM
#113
srosson avatar

srosson

New Zenner

Join Date:
Apr 2009
Posts:
1
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

I was having this same issue which I posted on the ChaseHosting support forums, they responded extremely quickly and had me pointed in the right direction within minutes.. and they WEREN'T EVEN MY HOST! Those guys are good to me.

Login Security Errors on Zencart
forums.chasehosting.com/index.php/topic,12.0.html

16 Jul 2009, 5:22 AM
#114
v_linck avatar

v_linck

New Zenner

Join Date:
Feb 2009
Posts:
14
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

dscvry:

Atticus - does this describe the phenomenon:
"... for both customer and admin logins, only the very first attempt with correct data input is bringing up the message 'There was a security error while trying to login'. The password asterisks stay in place, and simply tapping return once more then gets you in to the store/admin with apparently full functionality."
Not sure why that happens, but it can be lived with if so ... (dscvry post above fr June 2008) - sweet if that's the issue.

I've been experiencing exactly the same problem as described above. I'm using a fresh installation of Zencart v1.38a, so all the security tokens are in place. The tutorial regarding this issue actually says to add

<?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>

after every occurence of the password field (zen_draw_password_field function). This is already present in

  • /includes/templates/MY_TEMPLATE/templates/tpl_login_default.php and
  • /includes/templates/MY_TEMPLATE/templates/tpl_timeout_default.php

My question is, where is it meant to go in /admin/login.php (see my code below)? There is no "zen_draw_password_field." I can only guess that the line <input type="hidden" name="securityToken" value="<?php echo $_SESSION['securityToken']; ?>"> is doing the same job. Is this correct?

I'm currently using my own customised template, and have made some cosmetic css alterations to the appearance of the admin login pages (see code plus jpg example below). Other addons that are installed include: About Us Page, Column Divider Pro, Column Layout Grid, CSS Menu, Flash Hacks, Newsletter Subscribe, Time Zone Offset and RFQ. The problem was also happening before AND after I had installed an SSL, and even after I've installed the latest security patch. I've read all the posts regarding this issue but none seem to really resolve this.

To me, it seems like a random occurence. It doesn't always happen but sometimes it even happens after I've just rebooted the computer or cleared the cache etc. I am able to get through past the login via the store front or admin after my second or third attempt and everything else seem to function without a problem thereafter. I've only come across this problem once in the store front when trying to log in as a customer. The message occurs more in the admin, maybe because I've been logging in to the admin section more than the store front.

I am happy to just ignore this occurence and simply just live with it as suggested, but I want to be sure that I am not ignoring a serious security issue that will come back to bite me later down the track after the store has gone live. I am actually just inclined to change the message from "There was a security error when trying to login" to a less menacing warning like "There was an error when trying to login" in order to prevent my client and the shop customers from panicking when seeing this message. At this point I am very hesitant to go live until this problem is completely resolved. So, if anyone has a solution, please, please share.

<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | [email protected] so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: login.php 6522 2007-06-20 23:34:31Z wilt $
//

  require('includes/application_top.php');

  $message = false;
  if (isset($_POST['submit'])) {
    $admin_name = zen_db_prepare_input($_POST['admin_name']);
    $admin_pass = zen_db_prepare_input($_POST['admin_pass']);
    $sql = "select admin_id, admin_name, admin_pass from " . TABLE_ADMIN . " where admin_name = '" . zen_db_input($admin_name) . "'";
    $result = $db->Execute($sql);
    if ((!isset($_SESSION['securityToken']) || !isset($_POST['securityToken'])) || ($_SESSION['securityToken'] !== $_POST['securityToken'])) {
     $message = true;
      $pass_message = ERROR_SECURITY_ERROR;      
    }
    if (!($admin_name == $result->fields['admin_name'])) {
      $message = true;
      $pass_message = ERROR_WRONG_LOGIN;
    }
    if (!zen_validate_password($admin_pass, $result->fields['admin_pass'])) {
      $message = true;
      $pass_message = ERROR_WRONG_LOGIN;
    }
    if ($message == false) {
      $_SESSION['admin_id'] = $result->fields['admin_id'];
      if (SESSION_RECREATE == 'True') {
        zen_session_recreate();
      }
      zen_redirect(zen_href_link(FILENAME_DEFAULT, '', 'SSL'));
    }
  }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link href="includes/stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body id="login" onload="document.getElementById('admin_name').focus()">
<form name="login" action="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>" method = "POST">
  <fieldset>
    <!--<legend><?php echo HEADING_TITLE; ?></legend>-->
    <span class="loginMessage"><?php echo $pass_message; ?></span>
     <br /><br /> 
    <label class="loginLabel" for="admin_name"><?php echo TEXT_ADMIN_NAME; ?></label>
<input style="float: left" type="text" id="admin_name" name="admin_name" value="<?php echo zen_output_string($admin_name); ?>" />
<br class="clearBoth" />
    <label  class="loginLabel" for="admin_pass"><?php echo TEXT_ADMIN_PASS; ?></label>
<input style="float: left" type="password" id="admin_pass" name="admin_pass" value="<?php echo zen_output_string($admin_pass); ?>" />
<br class="clearBoth" />

    <input type="hidden" name="securityToken" value="<?php echo $_SESSION['securityToken']; ?>">
    <input type="submit" name="submit" class="button" value="Login" />
    
 <br /><br />   
    
    <?php echo '<a class="resend_password" href="' . zen_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?>
<br />
<br />
<br />

<!--<?php /*?>    <span class="loginMessage"><?php echo $pass_message; ?></span><?php */?>-->
  </fieldset>
</form>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>
20 Jul 2009, 12:38 AM
#115
lcarlo1507 avatar

lcarlo1507

New Zenner

Join Date:
Apr 2008
Posts:
72
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

I installed the puple lily zencart. I upgraded to 1.3 8a. What i didn't realize the purple lily was 1.37 but i really love the site.

I get a security error for customers to log in. I read some of the help but I';m still confused where to find the file to merge and how to merge it.

Please help

23 Jul 2009, 3:45 PM
#116
peacefuldaze avatar

peacefuldaze

New Zenner

Join Date:
May 2007
Posts:
26
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

I struggled with this same error message for hours last night when i upgraded to 1.3.8a and i've pulled out all my hair. luckily i number every strand so they're easily replaced in just such an emergency. i beleive i've discovered one very simple error that drove me nuts and will hopefully prevent this with someone else.

basically, when you update both configure.php files on the admin and store sides, you need to actually make sure they updated. when i do any updates, i use a FTP program or the CP file manager to upload my updated files. happens no matterhow i make the update.

i know the following is basic programming, but sometimes we need a reminder.
when you want to update these configure.php files, the first thing you must do is to change the permissions of each file to 644, and not 444. the 6 allows you to rewrite, or overwrite the file. if you do not do this and attempt to overwrite the original file, it will not overwrite, even though it looks like it did. nothing will actually be rewritten and the original error causing file still exists. permissions must be set to 644 to make changes.

basically, i thought i was updating the files in reality the system was blocking this.
i found this out using the CP file manager. I wanted to update the configure.php on the admin side and had to change the ENABLE SSL from "false" to "true". i did not change the permissions at first and only used the EDIT FILE link. i edited the file from false to true and then saved it thinking hte update had been made. no such luck.

when i tried to log into an account on the website, same error again. when i went back to the file manager to edit the same file i just edited, it still showed "false", like i made no update at all.

that's when i realised the permissions were preventing any update. before you edit the file using CP file manager, or an FTP client, change the persmissions of the configure.php file to 644 and save. then open and edit the file, make your changes, then save the file. then edit persmissions again back to 444 (if you don't set it back to 444, you'll get another error message at the top of your home page saying you're vulnerable, simply set back to 444 and it will be solved).

now try it and see if this solved it. i tried for hours never realising that my updates were never being accepted. same with an FTP program. chaneg the permissions first, then you can overwrite the file, then change the permissions back to 444.
hope this helps someone else out there.

i know this is obvious to many of you, but i spent hours trying to solve the problem and read every single post about this problem and this is what solved it for me. maybe it'll save someone a few hair follicles.

i believe its only the configure.php files that require you to change the permissions. other filed do not need as they are not critical and security related.
peace,
jbrird

23 Jul 2009, 3:58 PM
#117
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: "There was a security error when trying to login" - v1.3.8

Thanks for posting the problem and solution to this issue ...

You would be amazed how many people do not see that the configure.php file on the server is not actually getting updated via FTP due to the permissions being set at 444 ...

Setting the permissions to 644 or deleting the file on the server and then uploading the new file is the solution as you have noted ...

Thanks for posting your upgrade nightmare ... :cool:

NOTE: and yes ... have done it myself more times than I care to count ... fortunately after the first dozen times I am faster now at catching this one ... :smartalec:

25 Jul 2009, 7:50 AM
#118
v_linck avatar

v_linck

New Zenner

Join Date:
Feb 2009
Posts:
14
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

Unfortunately, this still doesn't solve my issue as my version of zen cart was a fresh install of v1.38a. My file permissions for both my config files were set to 644 so there were no problems there. I have just experienced the second occurrence of the error in the shop front whilst logging in as a customer. I have provided a screen shot. Again I was able to login without further problems after I hit the login button a second time.

25 Jul 2009, 8:02 AM
#119
v_linck avatar

v_linck

New Zenner

Join Date:
Feb 2009
Posts:
14
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

I meant to add that I will reset the file permissions back to 444 as suggested so I hope this solves my problem too. Thanks

30 Jul 2009, 1:15 PM
#120
golfador avatar

golfador

New Zenner

Join Date:
Jul 2009
Posts:
36
Plugin Contributions:
0

Re: "There was a security error when trying to login" - v1.3.8

After no upgrades or any site tweaking I started getting this error. It started last night. What would cause this to just happen?