Jump to content


Photo

Session Security


  • Please log in to reply
1 reply to this topic

#1 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 14 October 2006 - 12:50 PM

Right, Im just wondering how much I can rely on the security of SESSIONS

On my site, I use a lot of $_GET which is obviously an ideal opportunity for hackers to code inject

However, When querying or updating mysql, I also use the following method

$user = $_SESSION['user'];
$query = "SELECT * FROM `members` WHERE `username` = $user LIMIT 0,1"

As you can see, it will only query the row that has a username equal to $user


Now, what are the chances of a hacker spoofing the session to make it equal what ever they want

I would love to change the world, but they won't give me the source code

SEO Agency

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 14 October 2006 - 01:46 PM

They wont.

As the session is stored on the server and not on the client. The only way for a hacker to spoof a session is by getting a valid session id. In order to get the session id they need to be in the same room as you.

Also about $_GET you should be validating the input not use raw GET data.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users