Community Forums

Possible OpenCart Security Issue

News, updates and important issues relating to OpenCart.

Possible OpenCart Security Issue

Postby Daniel » Tue Sep 06, 2011 4:13 pm

I have just become aware of a security problem with OpenCart 1.5.x and all previous versions.

The fix is here:

http://code.google.com/p/opencart/source/detail?r=577

you need to replace your library cache file.

system/library/cache.php

with

cache.php
(1.16 KiB) Downloaded 2583 times


So far all it does is overwrite files in your site with blank ones.

I'm going to release a version 1.5.1.2 with the fix included.

sorry about this guys. I'm really kicking myself for not finding this sooner.
OpenCart®
Project Owner & Developer.
OpenCart commercial support now available!
User avatar
Daniel
Administrator
 
Posts: 5173
Joined: Fri Nov 03, 2006 10:57 am

Re: OpenCart Security Issue

Postby extigo » Tue Sep 06, 2011 4:36 pm

Maybe I doesn't understand correctly but is this also needed for the version 1.4.9.x and lower?
Op al uw computervragen een antwoord -- Extigo Computers
http://www.extigo.nl

Using OC 1.4.9.4
extigo
 
Posts: 172
Joined: Thu Dec 09, 2010 9:04 am

Re: OpenCart Security Issue

Postby Daniel » Tue Sep 06, 2011 4:53 pm

yes.

i have been testing this hack though and can;t seem to pull it off.

i'm still testing to see what has actually happened.
OpenCart®
Project Owner & Developer.
OpenCart commercial support now available!
User avatar
Daniel
Administrator
 
Posts: 5173
Joined: Fri Nov 03, 2006 10:57 am

Re: OpenCart Security Issue

Postby mkh » Tue Sep 06, 2011 5:06 pm

Daniel wrote:I'm going to release a version 1.5.1.2 with the fix included.


So, I can still use my 1.5.1.1 if using this fix, the cache.php ?

Thanks.
mkh
 
Posts: 29
Joined: Thu Jun 23, 2011 5:55 pm

Re: OpenCart Security Issue

Postby Daniel » Tue Sep 06, 2011 5:07 pm

ok possible false alarm.

i just checked the code and their is no way this could happen.

it was reported here:

http://vickigroup.wordpress.com/2011/09 ... -versions/

they reported it today.

can anyone else please try to see if they can get this hack to work.
OpenCart®
Project Owner & Developer.
OpenCart commercial support now available!
User avatar
Daniel
Administrator
 
Posts: 5173
Joined: Fri Nov 03, 2006 10:57 am

Re: Possible OpenCart Security Issue

Postby JAY6390 » Tue Sep 06, 2011 5:32 pm

I can see where they are coming from with the unsanitized data, but it shouldn't actually work, and I can't get it to replicate. That said, it is possible for someone to fill your cache folder with loads of useless files. Say for example I put country_id=1.1.1.1.1.1.1.1 That would still make a cache file for country id 1 but the wrong cache name. This should be stemmed to just 1 using (int) like in the query in the localisation/zone model file
ImageImageImage

Better Product SEO URL's - Perfectly structured product links
Better Category SEO URL's - Give subcategories the same SEO keyword
SEO URL's Route Editor - Fix all of your index.php links


Image
User avatar
JAY6390
 
Posts: 4633
Joined: Wed May 26, 2010 3:47 pm
Location: United Kingdom

Re: Possible OpenCart Security Issue

Postby Xsecrets » Tue Sep 06, 2011 6:07 pm

regardless I don't think the problem is going to be in the cache file itself, but in other files that call it using unsanitized data.
Xsecrets
 
Posts: 5042
Joined: Sat Oct 24, 2009 7:51 pm
Location: FL US

Re: Possible OpenCart Security Issue

Postby Xsecrets » Tue Sep 06, 2011 6:26 pm

I couldn't get it to work either, though I suppose that for this particular file you should sanitize the get by calling it with an int which would kill the attack vector, and then for good measure you could check to make sure data is actually returned before you call the cache set.
Xsecrets
 
Posts: 5042
Joined: Sat Oct 24, 2009 7:51 pm
Location: FL US

Re: Possible OpenCart Security Issue

Postby grgr » Wed Sep 07, 2011 2:15 pm

It very much works and allows you to overwrite files and take the site down. I've tested it on on one live web server running a default(ish) install of 1.5.1.1.
Image Image Image Image Image Image
User avatar
grgr
 
Posts: 814
Joined: Mon Mar 28, 2011 8:08 am

Re: Possible OpenCart Security Issue

Postby dony_b » Wed Sep 07, 2011 2:38 pm

So whats it gonna be ?

Update the cache.php file or not ?
User avatar
dony_b
 
Posts: 233
Joined: Wed Aug 18, 2010 1:56 pm
Location: Boston, MA

Re: Possible OpenCart Security Issue

Postby JAY6390 » Wed Sep 07, 2011 2:43 pm

There's no reason you can't update the cache file, but it should be the data input that's sanitized IMO
ImageImageImage

Better Product SEO URL's - Perfectly structured product links
Better Category SEO URL's - Give subcategories the same SEO keyword
SEO URL's Route Editor - Fix all of your index.php links


Image
User avatar
JAY6390
 
Posts: 4633
Joined: Wed May 26, 2010 3:47 pm
Location: United Kingdom

Re: Possible OpenCart Security Issue

Postby Xsecrets » Wed Sep 07, 2011 3:13 pm

grgr wrote:It very much works and allows you to overwrite files and take the site down. I've tested it on on one live web server running a default(ish) install of 1.5.1.1.

can you explain exactly how you managed to make it work, because as reported it very much does not work. If you don't want to post in in the open please PM me.
Xsecrets
 
Posts: 5042
Joined: Sat Oct 24, 2009 7:51 pm
Location: FL US

Re: Possible OpenCart Security Issue

Postby grgr » Wed Sep 07, 2011 9:12 pm

pm'd
Image Image Image Image Image Image
User avatar
grgr
 
Posts: 814
Joined: Mon Mar 28, 2011 8:08 am

Re: Possible OpenCart Security Issue

Postby Daniel » Thu Sep 08, 2011 2:43 am

grgr wrote:It very much works and allows you to overwrite files and take the site down. I've tested it on on one live web server running a default(ish) install of 1.5.1.1.


can u you pm me this hack aswell?
OpenCart®
Project Owner & Developer.
OpenCart commercial support now available!
User avatar
Daniel
Administrator
 
Posts: 5173
Joined: Fri Nov 03, 2006 10:57 am

Re: Possible OpenCart Security Issue

Postby Xsecrets » Thu Sep 08, 2011 3:46 am

I was able to get it to write files with additional testing, but I could not make it overwrite files. On my setup the %00 killed it, but from other claims I'm guessing it works on some configurations.
Xsecrets
 
Posts: 5042
Joined: Sat Oct 24, 2009 7:51 pm
Location: FL US

Re: Possible OpenCart Security Issue

Postby Daniel » Thu Sep 08, 2011 3:58 am

i got it to work. i did not use (int) on some of the cache names when selecting the country_id.
OpenCart®
Project Owner & Developer.
OpenCart commercial support now available!
User avatar
Daniel
Administrator
 
Posts: 5173
Joined: Fri Nov 03, 2006 10:57 am

Re: Possible OpenCart Security Issue

Postby wolfsteritory » Thu Sep 08, 2011 6:41 am

JAY6390 wrote:There's no reason you can't update the cache file, but it should be the data input that's sanitized IMO



what exactly do you mean by that ?

thank you
User avatar
wolfsteritory
 
Posts: 81
Joined: Sat Jan 31, 2009 6:08 pm

Re: Possible OpenCart Security Issue

Postby FlexiHost » Thu Sep 08, 2011 7:34 am

What about 1.4.9.x versions? does this fix apply for that as well?
FlexiHost
 
Posts: 42
Joined: Mon Mar 01, 2010 10:13 pm
Location: Christchurch, New Zealand

Re: Possible OpenCart Security Issue

Postby Joxe » Thu Sep 08, 2011 1:10 pm

FlexiHost wrote:What about 1.4.9.x versions? does this fix apply for that as well?


As far as I know, this is meant for EVERY versions...
v. 1.4.9.6 & v. 1.5.1.1
Joxe
 
Posts: 202
Joined: Tue Apr 27, 2010 10:12 pm

Re: Possible OpenCart Security Issue

Postby Johnathan » Thu Sep 08, 2011 1:13 pm

Yes, the /system/library/cache.php file from 1.5.1.2 works on 1.4.x versions.
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 2848
Joined: Thu Dec 17, 2009 7:08 pm

Next

Return to News & Announcements

Who is online

Users browsing this forum: andrejuseu and 15 guests

cron
Hosted by Arvixe Web Hosting