Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

security issues with URL's


9 replies to this topic

#1 vinnie@krystal

  • Community Member
  • 80 posts
  • Real Name:bavlis
  • Gender:Male

Posted 13 October 2009, 16:48

Hi Everyone, I have had a problem with security issues with my shop. i have created a login page which works fine. The problem here is how do i overcome when once the user has logged in they are able to copy the URL link and are able to bypass the login page by pasting the URL in the address bar.

What i am looking for is by some how a default where they are returned back to login page and cannot access the shop until they complete login.

Anyone have any idea how this may be acheived? many thanks if you able to help...

#2 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 13 October 2009, 17:07

View Postvinnie@krystal, on 13 October 2009, 16:48, said:

once the user has logged in they are able to copy the URL link and are able to bypass the login page by pasting the URL in the address bar.

You can clean the query string with security pro, find details of that & other security measures here.

If you have register_globals set to on it allows the user to do much with the url, so turn rg off & fix the store so it works that way.


there is Register Globals Easy http://addons.oscommerce.com/info/5729 or better still Upgrading osC from 2.2 MS2 to 2.2 RC2a http://addons.oscommerce.com/info/6654
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#3 Jack_mcs

  • Community Member
  • 24,449 posts
  • Real Name:Jack
  • Gender:Male

Posted 13 October 2009, 17:41

View Postvinnie@krystal, on 13 October 2009, 16:48, said:

Hi Everyone, I have had a problem with security issues with my shop. i have created a login page which works fine. The problem here is how do i overcome when once the user has logged in they are able to copy the URL link and are able to bypass the login page by pasting the URL in the address bar.

What i am looking for is by some how a default where they are returned back to login page and cannot access the shop until they complete login.

Anyone have any idea how this may be acheived? many thanks if you able to help...
Each secure page should have code to verify the user is logged in. Check any of the files that are secure, like create account, and copy the code block that checks if the customer is registered to your new page. When the page is copied, the login status will be checked and you won't be able to continue unless logged in. If the url contains the session ID, then that is a different problem and you need to fix that before anything else.

#4 vinnie@krystal

  • Community Member
  • 80 posts
  • Real Name:bavlis
  • Gender:Male

Posted 13 October 2009, 18:04

hi thats great i thought it would require some sort of verification on each page being visited and so you have confirmed this for me. reference RG being turned on i will check out the link you have provided spooks although i am certain the RG are set to off.

#5 Java Roasters

  • Community Member
  • 2,145 posts
  • Real Name:Peter Bernard
  • Gender:Male
  • Location:Kagawong Ontario, Canada

Posted 13 October 2009, 19:01

Try adding this at the top of the pages you need to only have logged in people view. It is the same as on all the SSL pages in osC such as account_edit.php which you can view for a reference.

  if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  }


#6 vinnie@krystal

  • Community Member
  • 80 posts
  • Real Name:bavlis
  • Gender:Male

Posted 14 October 2009, 12:24

hi i did what you asked and pasted that piece of code into the top page, for some reason i want to revert back to my previuos settings but its now not letting me do that i am just getting a login page...i.e not directed to my index.php.

can you help on why that would be..thanks

#7 Java Roasters

  • Community Member
  • 2,145 posts
  • Real Name:Peter Bernard
  • Gender:Male
  • Location:Kagawong Ontario, Canada

Posted 14 October 2009, 15:34

I thought you wanted non logged in people to go to your login page. If you want them to be directed to your index.php page instead then it would be

  if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL'));
  }

All I have done here is redirect it to a different page.


If you don't want the added code there, if it is not what you are looking for then you can just remove it and revert your pages back to their original form and it will be as it was before. You might need to refresh your browser.

#8 vinnie@krystal

  • Community Member
  • 80 posts
  • Real Name:bavlis
  • Gender:Male

Posted 14 October 2009, 15:56

what i wanted was to stop any user from copying and then pasting the URL address once they have logged in as for security purposes all they would need to do next time is to bypass my login page by pasting the copied URL in the address bar. I have created my own login page prior to oscommerce store.

for some reason it doesnt revert back to default i think it registers it somewhere in the database which didnt allow the revert back

if (!tep_session_is_registered('customer_id'))

therefore it stores this information and even if you took this code out it creates it as a session.

#9 Java Roasters

  • Community Member
  • 2,145 posts
  • Real Name:Peter Bernard
  • Gender:Male
  • Location:Kagawong Ontario, Canada

Posted 14 October 2009, 16:07

The session does expire so it should not allow them to bypass the login after about 10 minutes. Can you test it again and this time empty the sessions table (just empty, don't delete the table) in between your tests.

The session that is created stores a lot of info including if the customer is registered. The session should expire in 10 minutes (I think) and then if a person uses it after that time they should get a new session without been registered and therefore be sent back to the login page.

What you are doing will also prevent Google and other search engines from indexing your pages so your protected pages will not show up on the search engines.

#10 Jack_mcs

  • Community Member
  • 24,449 posts
  • Real Name:Jack
  • Gender:Male

Posted 14 October 2009, 16:42

View Postvinnie@krystal, on 14 October 2009, 15:56, said:

what i wanted was to stop any user from copying and then pasting the URL address once they have logged in as for security purposes all they would need to do next time is to bypass my login page by pasting the copied URL in the address bar. I have created my own login page prior to oscommerce store.
As mentioned, it's a non-issue unless your session ID is being copied. If that is the case, you are "fixing" the wrong code.