Jump to content
MakeWebGames

Possible Exploit Fix


Aqua

Recommended Posts

I think i found an area that could be exploited;

The query would be;

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

The variables contains these data:

$by = id ($_GET['by'])

$ord = ASC/DESC ($_GET['ord'])

$st = 0/100/200/etc.(increases on no of pages.) ($_GET['st'])

The fix to this would be;

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Guest Anonymous

Re: Possible Exploit Fix

It's a good point though LK...

Often people use $_GET or $_POST to directly create SQL statements ie. field names, sort order, direction and limits.

Your solution demonstrates that any parameters coming in MUST be sanitized before use.

Ideal for hall of fame / user lists where you may want to change the sort order or even what is displayed.

Link to comment
Share on other sites

Guest Anonymous

Re: Possible Exploit Fix

Well you would do - LIMIT ,100 should be LIMIT n,100 WHERE n is an integer defining the starting offset from where to fetch the data.

The OP was merely suggesting a good method of ensuring that certain types of data passed from the user are thoroughly sanitized before being fed through to the database.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...