note 74183 added to ref.session
| From: | gordon_e_rouse at yahoo dot com dot au | Date: | Thu, 29 Mar 2007 03:06:14 +0000 |
| Subject: | note 74183 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124902@lists.php.net to get a copy of this message | ||
Multi-site security risk!
Suppose you use session security to determine login status, and you have several such sites on the
webserver which essentially assign a session token to determine your login status. A common
occurence for webdeveloping companies that have a standard system or package, and are not using a
high security setup. (ie all sites share the same session path directory)
PHP sends the browser a cookie and that cookie should only be valid for the site it was retrieved
from, but only the browser determines this, the server does not record the path or domain with the
session cookie, so technically you could modify the browsers cookie jar to send the same cookie
request for a different domain or path than what was originally meant.
This means that if the same session variables are used to determine a logon status on different
sites on this server, then the user can access all these sites with the one session id.
The solution is to write the domain and or path as session variables as well, thus when logged on
status is checked, the script checks that the session was created through the current domain or
path.
----
Server IP: 202.89.36.242
Probable Submitter: 222.154.242.155
----
Manual Page -- http://www.php.net/manual/en/ref.session.php
Edit -- https://master.php.net/note/edit/74183
Del: integrated -- https://master.php.net/note/delete/74183/integrated
Del: useless -- https://master.php.net/note/delete/74183/useless
Del: bad code -- https://master.php.net/note/delete/74183/bad+code
Del: spam -- https://master.php.net/note/delete/74183/spam
Del: non-english -- https://master.php.net/note/delete/74183/non-english
Del: in docs -- https://master.php.net/note/delete/74183/in+docs
Del: other reasons-- https://master.php.net/note/delete/74183
Reject -- https://master.php.net/note/reject/74183
Search -- https://master.php.net/manage/user-notes.php