Home > PHP >
Security Implications on Shared Hosts | Sitemap Search |
|
Sections Membership Features
Recent comments
very difficult by alfin Taking the credit for another persons work ? by curious dude. |
Security Implications on Shared HostsPosted by martin on 1 Jun 2002. Besides variables coming from query strings ($_GET), posted form data ($_POST), and cookies ($_COOKIE) you should treat session variables as tainted too if your site is on a shared host. User inputIf you have used Perl you probably have heard of tainted variables - they are variables that come from user input and as such shouldn't be trusted. The only way to untaint a variable in Perl is to use a regular expression to extract a value out of it. It doesn't matter what language you are using to build your scripts you should never trust user input. What's so special on shared hostsIf your site is on a shared hosting service that probably means that other people may have the ability to open your files and get sensitive data out of there. What's more if other sites on the host share the same domain - your site is reachable under a directory which is different from the root, cookies shouldn't be trusted. Not that it is a good idea to trust cookies but other people on the hosting service may generate sessions that will be valid for your site. Tainted variables
The superglobal arrays I didn't mention the case when you're using Commentsso... ??? by dude () on 24 Sep 2002 4:51pm GMT OOpss!! You forgot to write the solution for this problem !?? A solution by martin on 24 Sep 2002 5:39pm GMT The solution is to always check important session data. In my PHP login script there is an example which shows how you can check session data. It does not show all available methods but just a few to get you started. Security Implications on Shared Hosts by guillem (catalaestape@terra.es) on 26 Sep 2002 7:58pm GMT well basic things need to be done
well thats my 2 cents on protecting forms. :) On JavaScript by martin on 27 Sep 2002 5:05pm GMT The strange thing about JavaScript is that more and more people disable it according to statistics. In other words the JavaScript visitors are less than those who use browsers which support JavaScript - this should make you think about it before doing something client-side only. RE: On Javascript by Cameron () on 28 Nov 2003 7:33am GMT "other words the JavaScript visitors are less than those who use browsers which support JavaScript" Really? Which crack-pot website did you get that data from? Last I checked, a whole 3 months ago which was after the date of your post, the stats showed only 6% of users disabled javascript and a further 1% used browsers that didn't support it at all. 7% is a far cry from 51% or more. javascript by pxl () on 19 Jul 2004 5:08pm GMT Using javascript is ok, but it is by no means a method to rely on. And yes, some users have javascript disabled, especially panicked IE users maybe, hehe. Server-side validation using regExps , intval, stripping html and SQL comments is the best way I know, although it takes the workload to the server. |