PHP and security

Hey drop us a line about the show. Feel free to ask questions, provide feedback and criticism, or just ramble on about anything your little heart desires.

Moderators: snarkout, Patrick, dann

Post Reply
User avatar
BertVK
Posts: 18
Joined: Mon Aug 21, 2006 3:09 am
Location: Ghent, Belgium

PHP and security

Post by BertVK » Thu Feb 19, 2009 8:40 am

I've been listening to Pauldotcom.com security weekly lately and those guys are very, very negative about the security in PHP projects. What is not clear to me is whether it's PHP itself that is insecure or if it's the possibility of getting away with sloppy code that is the cause.

I am planning to start an open source project that I would like to be web based. I would like to use PHP because it's supported by almost all hosting providers. The alternative would be Python using the Django lib.

What is your opinion on security in regard of PHP(projects)?
Bert

User avatar
dann
Site Admin
Posts: 1132
Joined: Mon Apr 26, 2004 10:55 pm
Location: Hampton, Va, USA
Contact:

Re: PHP and security

Post by dann » Thu Feb 19, 2009 1:43 pm

There have been some inherent security issues with PHP in the past, but most of those have been addressed to the level that they could be. Pretty much the problems these days result form sloppy/lazy coding.

User avatar
BertVK
Posts: 18
Joined: Mon Aug 21, 2006 3:09 am
Location: Ghent, Belgium

Re: PHP and security

Post by BertVK » Fri Feb 20, 2009 3:56 am

Hey, thanks Mr PH Guru,

Is there any protocols you live by to make your PHP projects secure?
IYO Are there specific libraries to avoid?
Bert

User avatar
eddie
Posts: 974
Joined: Wed Sep 05, 2007 10:46 pm
Location: here
Contact:

Re: PHP and security

Post by eddie » Wed Feb 25, 2009 12:19 am

Roadsend has a php compiler that might help hide code. I have not installed it yet though. I am try to get up to speed on php and mysql before I try anything fancy.

User avatar
CptnObvious999
Posts: 798
Joined: Fri Jun 03, 2005 7:54 pm
Location: Maryland
Contact:

Re: PHP and security

Post by CptnObvious999 » Wed Mar 04, 2009 9:59 am

Django has some nice SQL Injection prevention functions. You can visit http://en.wikibooks.org/wiki/PHP_Progra ... _Injection for some information on how to prevent this in PHP.

Base rule in PHP is NEVER trust anything that comes from $_POST or $_GET or $_COOKIE. Even if you have some information in a dropdown, it doesn't mean the only thing that can be returned on the next page is what you put in there. If you always validate data before you parse it you should be alright.

P.S. Stay away from eval

User avatar
eddie
Posts: 974
Joined: Wed Sep 05, 2007 10:46 pm
Location: here
Contact:

Re: PHP and security

Post by eddie » Wed Mar 04, 2009 4:27 pm

Thanx for the input. I am learning the new mysql and that will be a great help.

Post Reply