TomatoCart

65379 Downloads
339 users online
TomatoCart Community
Welcome, Guest
Please Login or Register.    Lost Password?
Bookmark and Share

Multiple CSRF Vulnerabilities
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: Multiple CSRF Vulnerabilities
#2358
Multiple CSRF Vulnerabilities 1 Year, 6 Months ago Karma: 0
There are some serious exploits shown here
www.exploit-db.com/exploits/14330/

What do you think about it? Is tomatoCart shop insecure?
mycle
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2367
Re:Multiple CSRF Vulnerabilities 1 Year, 6 Months ago Karma: 12
EDIT: I tested the change password one and it worked, so I suppose all work. The admin has to be logged in for them to work though. What someone can do then is to use these HTML codes on another website, and when the admin of the specific tomatocart visits this evil site, well, then they WILL WORK!

A way to prevent them from working is to check the referer and require it to be the tomatocart site.
xonium
Gold Boarder
Posts: 183
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Sweden
Last Edit: 2010/08/07 08:59 By xonium.
The administrator has disabled public write access.
 
#2374
Re:Multiple CSRF Vulnerabilities 1 Year, 6 Months ago Karma: 1
xonium wrote:
EDIT: I tested the change password one and it worked, so I suppose all work. The admin has to be logged in for them to work though. What someone can do then is to use these HTML codes on another website, and when the admin of the specific tomatocart visits this evil site, well, then they WILL WORK!

A way to prevent them from working is to check the referer and require it to be the tomatocart site.


These things currently only work when you are logged in as administrator.

In the JSON server side parser there os the following line:

Code:


if (isset($_SESSION['admin']) || ($_REQUEST['module'] == 'login'))



So if you aren't logged in into the admin you can't execute the calls. If you want to do this u first have to do a session hijacking.

But good that people are posting possible security leaks (better than keeping it in the underground), and I hope the team takes them very seriously and puts effort in security.
E-volutions
Gold Boarder
Posts: 294
graphgraph
User Offline Click here to see the profile of this user
Gender: Male TomatocartHosting ward@e-volutions.be Location: Belgium, Leuven

TomatocartHosting launching soon!


The administrator has disabled public write access.
 
#2377
Re:Multiple CSRF Vulnerabilities 1 Year, 6 Months ago Karma: 1
xonium wrote:

A way to prevent them from working is to check the referer and require it to be the tomatocart site.


NO! Do not do this as the security check. A referring URL is easily spoofed. How to Spoof a Referrer

Here is the proper way to do it: Create a CSRF Token (Just the PHP one...not the Zend framework one)

Brief summary: When you load a page with a form that gets submitted to json.php you create a unique token - preferably something cryptographically secure and at least psuedo-random. Store this value in the session ($_SESSION['csrf'], perhaps?). On the form you add a hidden field and also put the token information. At this point they should match.

When you submit the form to json.php, json.php will check the $_SESSION['csrf'] value and compare it to the form value that is submitted along with the form. If they do not match, then something funky is going on here. If they match, proceed with the rest of the logic.

A very quick check of the source shows that there are at least 52 files that reference json.php in some way
Code:


grep -nri "json\.php" ./ | cut -f1 -d":" | sort | uniq
./admin/external/json/json.php
./admin/includes/classes/json.php
./admin/includes/filenames.php
./admin/includes/jsons/products.php
./admin/json.php
./admin/templates/default.php
./admin/tocdesktop.php
./ext/json/json.php
./ext/piwik/config/manifest.inc.php
./ext/piwik/core/DataTable/Renderer/Json.php
./ext/piwik/libs/open-flash-chart/php-ofc-library/JSON.php
./ext/piwik/libs/open-flash-chart/php-ofc-library/open-flash-chart.php
./ext/piwik/modules/DataTable/Renderer/Json.php
./includes/classes/json.php
./includes/javascript/ajax_shopping_cart.js
./includes/javascript/checkout.js
./includes/javascript/polls.js
./json.php
./templates/admin/external/json/json.php
./templates/admin/includes/classes/json.php
./templates/admin/includes/filenames.php
./templates/admin/includes/jsons/products.php
./templates/admin/json.php
./templates/admin/templates/default.php
./templates/admin/tocdesktop.php
./templates/ext/json/json.php
./templates/ext/piwik/config/manifest.inc.php
./templates/ext/piwik/core/DataTable/Renderer/Json.php
./templates/ext/piwik/libs/open-flash-chart/php-ofc-library/JSON.php
./templates/ext/piwik/libs/open-flash-chart/php-ofc-library/open-flash-chart.php
./templates/ext/piwik/modules/DataTable/Renderer/Json.php
./templates/glass_gray/content/checkout/checkout.php
./templates/glass_gray/javascript/auto_completer/auto_completer.js
./templates/glass_gray/javascript/popup_cart/popup_cart.js
./templates/includes/classes/json.php
./templates/includes/javascript/ajax_shopping_cart.js
./templates/includes/javascript/checkout.js
./templates/includes/javascript/polls.js
./templates/json.php
./templates/templates/glass_gray/content/checkout/checkout.php
./templates/templates/glass_gray/javascript/auto_completer/auto_completer.js
./templates/templates/glass_gray/javascript/popup_cart/popup_cart.js
./templates/tomatocart_furniture/content/checkout/checkout.php
./templates/tomatocart_furniture/javascript/auto_completer/auto_completer.js
./templates/tomatocart_furniture/javascript/page/pageTool.php
./templates/tomatocart_furniture/javascript/popup_cart/popup_cart.js
./templates/tomatocart_furniture/javascript/products/products_view.php
./templates/tomatocart_games/javascript/auto_completer/auto_completer.js
./templates/tomatocart_games/javascript/popup_cart/popup_cart.js
./templates/tomatocart_toy/content/checkout/checkout.php
./templates/tomatocart_toy/javascript/auto_completer/auto_completer.js
./templates/tomatocart_toy/javascript/popup_cart/popup_cart.js

MooMoo
Junior Boarder
Posts: 30
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2010/08/07 19:20 By MooMoo.
The administrator has disabled public write access.
 
#2386
Re:Multiple CSRF Vulnerabilities 1 Year, 6 Months ago Karma: 12
You guys don't seem to fully understand the attack.

You don't really need to hijack the session, it's not the evil guy that are executing the attacks directly. The evil guy puts up a website with these codes for example. He sends an email to the victim, the admin of a specific tomatocart site, the victim visits the website and if the victim is logged in as admin to his tomatocart site, it's the victim itself who executes these codes. And in this case a referer check IS a protection. You can spoof your own referer, not someone elses!
xonium
Gold Boarder
Posts: 183
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Sweden
The administrator has disabled public write access.
 
#2388
Re:Multiple CSRF Vulnerabilities 1 Year, 6 Months ago Karma: 12
Ok I figured a little and MooMoos solution would be the best!

A referer check would work, if not like now, you can read emails inside the admin interface.
That's very dangerous as you could put these codes then right there in the email and if the admin then supports HTML emails, I don't know as I haven't tested, well then the code will be executed and the correct referer would be set so in this case it's correct that referer check isn't a protection.
xonium
Gold Boarder
Posts: 183
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Sweden
The administrator has disabled public write access.
 
Go to top Page: 12
Moderators: uspshooter

Latest Blog Post

TomatoCart v2.0 – An open source ecommerce framework

Since the TomatoCart v1.0’s framework getting old and the core is not a pure MVC design, it causes many troubles ...

Blog | Administrator | Saturday, 21 January 2012

More in: About Us

-
+
3

contact_us

TomatoCart
+86-13771170725
info@tomatocart.com
http://www.tomatocart.com

Newsletter Subscription

Name:

E-Mail:

Verification Code:
Captcha

Receive HTML?