Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AbsoluteBreeze

Pages: [1]
1
Modifications / Re: SMFPets Version 0.2
« on: June 27, 2007, 05:56:34 am »
Sorry - your right I meant ALPHA ;D

Whoever coded this (i'm still new here) has got a great product off the ground and I would like to say that I am not criticising - just pointing out some things that could be improved either by the original author or by the community.

I've been looking over this script and it really needs some attention.... probably more than I can offer.

The immediate thing that is problematic is that *all* $_GETS are being pushed straight into SQL query's. That opens the door for SQL injection.

For instance..

Shop-Pets.php - lines 56 - 58
Code: [Select]
elseif (isset($_GET['pet'])) {
$result = db_query("SELECT breed FROM {$db_prefix}shop_pets WHERE pet_id = {$_GET['pet']}", __FILE__, __LINE__);


That code is taking a variable $_GET['pet'] from the URL and squirting it directly into mysql,

The thing I noticed about it is that its a number - so lets convert it to a number(integer) first at the top of the function.

Code: [Select]
$_GET['pet'] = (int) $_GET['pet'];

As for non numbers (pet names etc) then other methods exist to clean them.

stripslashes($_POST['name']) should perhaps be used in place of $_POST['name'] on its own - or even in some cases htmlspecialchars($_POST['name'])

Luckily SMF does have a little protection for this... however it does mean that its easy to trip the script over and to lockup someones petshop.

Im not the most perfect programmer - so please don't take what I am saying as gospel, however I would suggest looking into sanitization methods.

2
Modifications / Re: SMFPets Version 0.2
« on: June 27, 2007, 03:01:12 am »
Many people could argue that windows XP isn't truly out of BETA :) - that doesn't mean the product is dead.

Pets source is open for people to see/modify and fix.

I want this product and if that means getting my hands dirty then so be it. I'm not saying I am going to fix everything - but  I'll try and help where I can.


3
Modifications / Re: SMFPets Version 0.2
« on: June 26, 2007, 04:16:35 pm »
It appears that the pets mod is open to a little security problem (highlighted in the SMF error log).

The desc field is sent to SQL without being cleansed - I guess this means it might be open to SQL injection. I haven't tested the name field.

Apostrophes and possibly smiley codes in description cause SMF security to report hacking attempts.

This morning I woke up to my error log showing......
Quote
Hacking attempt...
UPDATE shop_pets
SET name = 'Plopsy',
level = 1,
curap = 1,
maxap = 1,
happy = 9,
`desc` = 'Fluffy just like it's owner ;0)',
hunger = 8,
age = 1,
training = 1,
trainingend = '07176012305',
ownerid = 4926
WHERE pet_id = 14
File: /home/testuser/public_html/forum/Sources/shop/pet_engine.php
Line: 305

4
General SMFShop Discussion / Re: Error - Undefined index: money
« on: June 22, 2007, 01:52:16 am »
On the latest smf shop (v3.0) the code around that area should be

Code: [Select]
// Begin SMFShop MOD Version New Version
'money' => isset($user_settings['money']) ? $user_settings['money'] : '',
'moneyBank' => isset($user_settings['moneyBank']) ? $user_settings['moneyBank'] : '',
// End SMFShop MOD

5
Modifications / Re: SMFPets Version 0.2
« on: June 21, 2007, 06:34:11 pm »
Thank you David :)

6
General SMFShop Discussion / Suggestion
« on: June 21, 2007, 06:33:33 pm »
First of all, Daniel - you have done very well with this.... its a great product - you should be proud ;)

Some thoughts

I think the defaults for enabled boards should be 0 not 1.

I have a large site and nearly 200 boards which I didn't want enabled.... luckily a simple sql update fixed the problem - but it would be nice to 'turn on' where needed.

The same situation appears with people having access to the shop - for sites with many groups this could be a pain. And perhaps access should be turned off by default.

Also, you seem to have text inside the template files, perhaps this would be better in the language files.





7
General SMFShop Discussion / Re: Error - Undefined index: money
« on: June 21, 2007, 06:27:17 pm »
Check the language files were modified when you applied the mod.


8
Modifications / Re: SMFPets Version 0.2
« on: June 21, 2007, 06:26:05 pm »
This looks like a great addon :)

Any chance of a new download link?


Pages: [1]