Post by SuperJuice » Sat Aug 15, 2009 9:48 pm

Found this one when looking at the Ajax calls.

/catalog/controller/product/product.php

Can force it to reference an undefined index.

If you call it on the URL, and don't use post like so:
<yourURL>/index.php?route=product/product/write&product_id=1

The following if on 393 fails on the first check on REQUEST_METHOD:
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
It then tries this but error['message'] hasn't been set yet because it hasn't been through the validate function:
$json['error'] = $this->error['message'];
So you end up with this, not good:
Notice: Undefined index: message in <basedir>/catalog/controller/product/product.php on line 398{"error":null}
Also, if it does correctly execute 'validate' (by using post to the above URL) it assumes all the variables are set, and you end up with
Notice: Undefined index: name in <basedir>/catalog/controller/product/product.php on line 418
Notice: Undefined index: text in <basedir>/catalog/controller/product/product.php on line 422
Notice: Undefined index: rating in <basedir>/catalog/controller/product/product.php on line 426
Notice: Undefined index: captcha in <basedir>/catalog/controller/product/product.php on line 430
{"error":"Error: Verification code does not match the image!"}
Might stop fiddling with it now and get back to cleaning up my own code.

I also don't mean to be overly critical, OpenCart's code is seriously well written and is an absolute credit to you.

Active Member

Posts

Joined
Thu Aug 13, 2009 12:06 pm
Who is online

Users browsing this forum: No registered users and 13 guests