If this is your first visit, check our documentation. To post, register or login.
Forums / Business Issues / Other Business Topics / zenID always present after changing http_server to https://

zenID always present after changing http_server to https://

Started by rixstix on 11 Mar 2017, 6:55 PM · Views: 1,496

Results 61 to 76 of 76
29 Apr 2017, 3:20 AM
#61
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

zenID always present after changing http_server to https://

This is probably unrelated. I was just trying to determine the security risk of having the ZENID in the URL.

So cache and cookies cleared, I visited my website, used the login box to log myself into my own personal customer account. It logged me in and circled me back to the homepage with the following URL:

https://example.com/index.php?main_page=index&zenid=abcdefghijklmnopqrstuvwxyz

So I took this URL, and gmail'ed it to my phone, different IP address etc etc, and I just opened the link.

I found myself automatically logged in on my phone. This is obviously normal? This is the basis of session hijacking right?

Just trying to make sure there isn't something I'm doing wrong.

30 Apr 2017, 3:38 AM
#62
drbyte avatar

drbyte

Sensei

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

Re: zenID always present after changing http_server to https://

Yes, that's the basis of session hijacking. That's why you should NEVER publicly post URLs containing a zenid in them ... whether on websites, or in newsletters or emails, etc.

If your server is properly configured, it will behave as I described 40+ posts back.

Now, let's NOT hijack THIS thread into a whole different direction.

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

30 Apr 2017, 3:47 AM
#63
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

Re: zenID always present after changing http_server to https://

Hi DrByte,

thanks. Well my host came back to me.

They initially thought it might be mod_security, or open_basedir causing the problem. But on further testing, neither of those issues resolved the matter. I disabled Suhosin reading threads on OSCommerce forums, but that wasn't the issue. I even tried to use ini_set to change the defaults for various session settings, and could not resolve the matter.

I suppose the temporary workaround that currently completely removes ZENID is the best solution for now.

That being said, a few years ago, I noticed our website posted on a forum. A user posted a link to a product page there, which included the ZENID. So I think this workaround solution, is better than the standard behaviour considering there's a lot of room for error when it comes to customers who don't know any better with regard to ZENID.

1 May 2017, 7:37 PM
#64
drbyte avatar

drbyte

Sensei

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

Re: zenID always present after changing http_server to https://

yaseent:

I think this workaround solution, is better than the standard behaviour
Which "workaround solution"?

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

1 May 2017, 7:42 PM
#65
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

Re: zenID always present after changing http_server to https://

Hey DrByte,

The edit to zen_href_link that RixStix found on that other forum thread.

I'm trying to write some code that ties a session to a secondary string but I for the life of me can't figure out sess write, read, and the handler function. I've given up for now.

1 May 2017, 7:59 PM
#66
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

I don't have enough where-with-all to know how other areas might be affected but

/includes/functions/html_output.php

commenting out lines 60-68 or thereabouts.... which "might" be a non-issue since both HTTP and HTTPS servers are the same in this particular instance.

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
      if (defined('SID') && zen_not_null(constant('SID'))) {
        $sid = constant('SID');
//      } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL_ADMIN == 'true') ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
      } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == 'true') ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
        if ($http_domain != $https_domain) {
          $sid = zen_session_name() . '=' . zen_session_id();
        }

If it is a server issue and is causing a person to lose sleep, then the proper, long-term resolution is to find and correct the server.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

2 May 2017, 6:10 PM
#67
drbyte avatar

drbyte

Sensei

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

Re: zenID always present after changing http_server to https://

RixStix:

DrByte:

You can do a preliminary comparison of PHP configs using the Server Info page in your Admin (copy screen contents to a text file, switch PHP versions, grab the updated screen contents, compare the two text files using WinMerge or Beyond Compare, etc)
TNX. Done. difference can be seen but that doesn't matter if a person doesn't know what to look for.
I can see differences that obviously can be ignored. Other differences is a whole different ball of wax.
In my review of the files, I agree: the obvious differences are related to deprecations/additions in PHP 5.6 vs 7.
I see no glaring subtle differences that would explain session issues.

On the plus side, wilt and I have been looking at a site running PHP 5.6 that does exhibit the symptoms you've been talking about ... and it's also a cPanel-hosted site. We're doing a number of tests to try to determine what's amuck.

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

2 May 2017, 6:13 PM
#68
drbyte avatar

drbyte

Sensei

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

Re: zenID always present after changing http_server to https://

As to the Force Cookie Use option, do you mind testing this idea, sometime when your site is low-traffic and you can do a test payment with your Authnet SIM module?

init_sessions.php, around line 65 or so:

if (SESSION_FORCE_COOKIE_USE == 'True') {
  zen_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, '/', (zen_not_null($current_domain) ? $current_domain : ''));

change to:```
if (SESSION_FORCE_COOKIE_USE == 'True') {
setcookie('cookie_test', 'please_accept_for_session', time()+606024*30, $path, (zen_not_null($cookieDomain) ? $domainPrefix . $cookieDomain : ''), $secureFlag);

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

3 May 2017, 12:08 AM
#69
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

DrByte:

As to the Force Cookie Use option, do you mind testing this idea, sometime when your site is low-traffic and you can do a test payment with your Authnet SIM module?

init_sessions.php, around line 65 or so:

if (SESSION_FORCE_COOKIE_USE == 'True') {
zen_setcookie('cookie_test', 'please_accept_for_session', time()+606024*30, '/', (zen_not_null($current_domain) ? $current_domain : ''));

> 
> change to:```
if (SESSION_FORCE_COOKIE_USE == 'True') {
  setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $path, (zen_not_null($cookieDomain) ? $domainPrefix . $cookieDomain : ''), $secureFlag);

The above code changed. Other edits related to this issue were not undone.
Force Cookie Use changed from FALSE to TRUE

WHOOPS. Session expired zencart screen.
Auth.net SIM authorized and captured the transaction

I am happy to test anything you ask. I will be leaving town for a week midday tomorrow and will not have convenient access to troubleshooting/editing.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

3 May 2017, 12:24 AM
#70
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: zenID always present after changing http_server to https://

Didn't make the time limit for an edit..

If ForceCookieUse is only an issue with Auth.net SIM, is it worth spending the time for a payment method that I just found out today was deprecated and will possibly sunset in the not too distant future? Auth.net ACCEPT HOSTED is the replacement.

Auth.net also said that AIM was in the "Supported but not updated" category with Auth.net API being the replacement.

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

3 May 2017, 12:58 AM
#71
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

Re: zenID always present after changing http_server to https://

Hi,

I'm happy to assist in any way I can. Please let me know.

3 May 2017, 2:19 AM
#72
drbyte avatar

drbyte

Sensei

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

Re: zenID always present after changing http_server to https://

RixStix:

If ForceCookieUse is only an issue with Auth.net SIM, is it worth spending the time for a payment method that I just found out today was deprecated and will possibly sunset in the not too distant future? Auth.net ACCEPT HOSTED is the replacement.

Auth.net also said that AIM was in the "Supported but not updated" category with Auth.net API being the replacement.
That's another topic, outside this thread. There are plans to rewrite the Authnet modules, perhaps later this summer. AIM will be supported for a long time yet. We'll open another thread about it when the time is relevant.

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

8 May 2017, 2:07 PM
#73
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

Re: zenID always present after changing http_server to https://

Hi,

just an update from my side.

I've noticed a really strange issue. With the workaround currently being used, the ZENID doesn't appear at all.

The issue is that when I look at my Who's Online from time to time, I notice one or two client's with a ZENID in the URL. I'm not sure how the ZENID gets there, but in all occasions, these were GUEST clients, not logged in or anything.

I can definitely confirm that some of the clients for which I see ZENID's are definitely human.

12 Jul 2017, 2:40 AM
#74
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

Re: zenID always present after changing http_server to https://

Hi DrByte...just checking in...

Any luck on finding the cause of the problem?

15 Jul 2017, 12:29 AM
#75
drbyte avatar

drbyte

Sensei

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

Re: zenID always present after changing http_server to https://

I just tested again on a half dozen sites running v1.5.5:

http_server is set to an https URL
no zenid is showing unnecessarily in the urls.

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

20 May 2018, 2:36 PM
#76
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: zenID always present after changing http_server to https://

Recently saw this on a 1.5.5e site running PHP 5.6. The problem was resolved by updating PHP to 7.1.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.