'Month of PHP Security' Finds 60 Bugs
darthcamaro writes "More than 60 bugs were reported in PHP over the last 30 days by the Month of PHP Security project. Most of the flaws, however, are ones that developers themselves can protect against with proper coding practices, according to Andi Gutmans, CEO of commercial PHP vendor Zend. He argues that PHP security is a matter of setting expectations. In his view, PHP — like all development languages — is only as secure as the code developers write with it. 'People should not expect PHP to be able to enforce security boundaries on a developer [who] has permissions to run custom PHP code,' Gutmans said. 'It's an inherently flawed scenario — and it's the wrong layer to protect in. People must rely on properly configured OS-level permissions for securing against untrusted developers.' Gutmans also praised the MOPS effort for elevating the profile of PHP security throughout the community, and for responsibly alerting the PHP project first with the bugs they found."
Sorry this is long, I could probably write a whole dissertation on my thoughts on PHP though.
I've been developing in PHP since version 2 way back in '97 and I've always felt that one of PHP's biggest downfalls is that it has a configuration file. I understand that it has more to do with its origins as an Apache module, but I can't think of many modules or programming languages that are so customizable as PHP is. Over the years this has led to different schools of programmers choosing one setting or another and chastising people who use a different setting.
Another big problem is that the core developers don't seem to get just how large the PHP community is. I found out some months ago that they were deprecating the ereg/POSIX regex set of functions in 5.3 and will be removing them in 6. I bought up on the mailing list that I think this is too quick of a time table for it being removed and that they should have it marked deprecated for at least 1 major version before removing it. Their excuse was that they really wanted to get UTF-8 support in PHP (a commendable goal) and the ereg functions weren't compatible and are also too slow. So now they are pushing the preg functions which are based on PCRE. Ironically all this time I've been avoiding the preg functions because I figured they were the more likely candidates to go away.
And I'm not alone. Many many people out there have been using ereg in lots of code over the past decade and its going to be a huge shock for them when it comes time to switch suddenly. When 50%+ of the dynamic web uses PHP, this is going to cause lots of problems over the next 5-10 years.
Yes yes, I know that there is work on a PEAR module to substitute the functionality of ereg, but my point is that the core developers seem to be in their own world and aren't thinking about the overall affects of their decisions and how far reaching they are.
As long as you expect PHP and the majority of code written in it to be insecure, you're expectations will be met. We call this setting your expectations appropriately. If you expect security from PHP, well, you need to learn to set your expectations appropriately.
"I use a Mac because I'm just better than you are."
At least they are working on finding bugs. The fact that they _found_ bugs shows that they are doing a thorough job.
This is A GOOD THING (TM)
Seven Days with Ubuntu Unity
I can live with the settings file, PHP has many more fundamental flaws than disparate configurations. The only real configuration schism I'm aware of was register_globals vs. not register_globals.
That and magic_quotes_gpc on or off. The ill-advised feature was on by default in PHP 4, and though official PHP 5 turned it off, a lot of shared hosting providers turn it back on to remain compatible with legacy PHP 4 code that their hosting clients might still be using.
People must rely on properly configured OS-level permissions for securing against untrusted developers.
Why not also blame the web server, the middleware (e.g., Tomcat/Jboss/etc), the database, and the client-side browser as well? While security problems at these layers certainly exist, they don't excuse any problems in PHP--and they certainly don't exonerate any developer for writing insecure code in the first place.
What if that untrusted coder is not an employee, but a customer? If you're hosting websites, and your client wants to write custom PHP, you need to rely on your OS features to ensure that his insecure code can't damage other users.
Give me Classic Slashdot or give me death!
Adult Role Playing Forum
But because the work-around for a bug is common knowledge doesn't make the bug any less of a bug. It does, however, give the devs an excuse for not fixing it, or making it lower priority than bugs that have no work-around.
*sigh* back to work...
proper coding practice != workaround