Slashdot Mirror


'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."

11 of 120 comments (clear)

  1. Re:One of the biggest problems is configurability by MightyMartian · · Score: 4, Insightful

    The configuration file is a problem, to be sure, but the real problem is their insane library which seems to fit no particular convention. It's goddamned madness and makes coding an incredibly painful experience as you constantly run back and forth to the online manual to get the exact name of the function. Out of that comes the constant deprecating and synonyms. I find PHP a painful, awkward language to code in, but because I do so much work supporting legacy stuff, I'm stuck with it.

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
  2. Re:One of the biggest problems is configurability by Gulthek · · Score: 3, Insightful

    "Now" they are pushing preg functions? Everything I've read on PHP for the last five years has been drilling "use preg instead of ereg because ereg is slow and going away". This isn't a sudden switch either, you've already had months to transition and you still have many more months before you need to cut over.

    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.

    Global namespace stuffed full of built-in functions. Inconsistent argument order for built-in functions (needle, haystack || haystack, needle). Inconsistent naming scheme for built-in functions. PHP is a dumb language when it comes to including other code, it doesn't even have a concept of "other" code: an include/require statement just dumps the entire contents of the file being pulled in.

    I could go on.

    Yes, I code PHP for a living.

  3. Setting expectations by 0racle · · Score: 3, Insightful

    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."
  4. Doing something about it. by AndGodSed · · Score: 4, Insightful

    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)

  5. Re:One of the biggest problems is configurability by 0racle · · Score: 4, Insightful

    I wouldn't say that Perl or Python suffer from what PHP suffers from.

    --
    "I use a Mac because I'm just better than you are."
  6. Re:One of the biggest problems is configurability by mcrbids · · Score: 5, Insightful

    I use PHP and I love it as a language. It's powerful, stable, and lets me get lots of work done quickly.

    That said, you hit on the two biggest annoyances I have with PHP:

    1) Argument order: is it myfunction($haystack, $needle) or myfunction($needle, $haystack)? There's no rhyme or reason that I can consider, mostly just random stuff.

    2) Function names: Is it going to be isinteger() or is_integer()? And even within a set of otherwise closely rlated functions, while php has is_integer(), is_set() is actually isset(). Who thought this was a good idea?

    Again, I don't want to knock PHP too badly, it's a lean mean workhorse of a language, and its many strengths vastly outweigh its weaknesses. But couldn't they pick a convention and move to it?

    --
    I have no problem with your religion until you decide it's reason to deprive others of the truth.
  7. Re:Untrusted developers by Hatta · · Score: 4, Insightful

    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!
  8. Re:One of the biggest problems is configurability by ducomputergeek · · Score: 3, Insightful

    Our front end has been PHP for a while because it was popular and we could find developers easily. And when we were in the development, speed and the ability to find programmers was a primary concern. However now we've added all the functionality needed and it's a mature/stable product, but in the last 18 months we've noticed quite a few of these "You shouldn't use thisFunction() because it is deprecated". Every couple months when we upgraded PHP to the latest version it seemed like we'd start seeing new warnings that some function we'd been using for years was being deprecated. The last straw for me was the deprecation of split(). We were spending more time for maintenance than what we wanted to commit to the project at this stage so we ended up porting the frontend to Perl. The backend had been Perl based since 1999/2000 and the last time we had to do any updates to those scripts was adding functionality in 2006.

    I know Perl is not sexy these days, but we use it a lot for things that we need done but don't want to spend a lot of time on maintenance. And I catch flack from some of the programmers who always want to use whatever "new hotness" is this year. But I'll take stable and mature any day of the week.

    --
    "The problem with socialism is eventually you run out of other people's money" - Thatcher.
  9. I would laugh... by Vekseid · · Score: 3, Insightful

    The fact that one of the bugs still remains from his original /2007/ Month of PHP Bugs shows that the PHP developers are clearly not doing a thorough job.

    ...but this sort of thing just makes me want to cry. Multiyear bugs exist in multitude. And these are just the ones they admit exists.

  10. Re:One of the biggest problems is configurability by Luke+has+no+name · · Score: 3, Insightful

    This, and the lack of a namespace concept (until recently) make me wonder, "Who would begin a greenfield web application in PHP when you have Python/Ruby/(kinda) Perl?" These are all strong languages. Ruby is fascinating, though it's only now coming into its own.

    Seriously, tell me, because I don't get it. You say its strengths outweigh its weaknesses. We've pointed out some damned big weaknesses, so what are its unique strengths?

  11. Re:One of the biggest problems is configurability by Mr.+Shiny+And+New · · Score: 4, Insightful

    PHP's strength: ubiquity. PHP is installed everywhere, so if you are intending for your application to be deployed on diverse machines with low-cost hosting it is a good bet. I like to code in Java but for my home website it's all PHP because that comes free with my hosting provider, whereas better environments are more complicated to set up or more expensive.