Month of PHP Bugs Has Begun
An anonymous reader writes "The previously announced Month of PHP Bugs started three days ago, and already lists 8 security vulnerabilities in PHP and PHP related software. From the site: 'This initiative is an effort to improve the security of PHP. However we will not concentrate on problems in the PHP language that might result in insecure PHP applications, but on security vulnerabilities in the PHP core. During March 2007 old and new security vulnerabilities in the Zend Engine, the PHP core and the PHP extensions will be disclosed on a day by day basis. We will also point out necessary changes in the current vulnerability management process used by the PHP Security Response Team.'"
We see a lot of people use the phrase "defective by design" when talking about Vista and in that instance I'm pretty sure the use of the term is correct.
Having never used PHP but heard of its many security problems I'm wondering: Is PHP defective by design? If so, why so and how would Slashdot seek to fix it?
Simon
To be honest i'm glad that this month of bugs is happening, after all the previous news items about how the core php / zend team is refusing to colaberate with some ppl who are deeply concerned about php's security (and by this we do mean mistakes/faults in the php engine, not in bad php programming).
:-)
On the other hand, i bet a fair few of the released vunerabilities will be applicable for many websites that the company i work for hosts, and i know corperate policy doesn't include frequent updates to their envirioment, there's just to many sites, to many badly supported applications by/for customers, and just to damn many servers to work with easily, i can't imagine were the only such company with such problems... And it really makes me wonder if this will mean that many hundreds of our hosted websites will from now on be easily hackable by scriptkiddies
Should prove to be interesting times, and who knows maybe it will teach our admins to use yum/rpm's for their servers instead of compiling their own apache/php combinations
To clarify, note that these bugs are related to the PHP core, not the language itself which may result in insecure applications. The statement that 8 security vulnerabilities in PHP and PHP related software is not referring to PHP software such as Wordpress. I mean seriously, I think I saw my dog hacking together a blog the other day using PHP. Everyone uses the language and not everyone has the background to know what they should and shouldn't be doing. In addition to its popularity, the language and its "libraries" make it easy for untrained coders to leave gapping holes in the code. Don't get me wrong, I love PHP (to an extend), I make a living out of it but any attempt at fixing "PHP related software" directly (ie: wordpress,phpbb,oscommerce,etc) would take more than a month.
[alk]
There are so many "Get me a portal, quick" / "I want to create a CMS that will make me rich" websites based on PHP based solutions that this exercise becomes obviously very important. It's surprising how many of such websites are severly insecure.
Just one month?
Beware of the unexpected behavior of a program... it brings joy to hackers all around the world.
"Defective by Design" usually refers to DRM, since that is what the FSF's campaign against DRM is called.
Brought to you by the numbers π, e, and 0x1B.
One of the biggest problems with PHP is the die-hard adherance to backwards compatibility. Functions don't get deprecated, the API doesn't change, it gets overloaded with nearly-the-same but-not-quite methods so that somewhere, somebody doesn't complain about how their website "broke" with the latest release--never mind the fact that by using insecure functions, their sites are already broke.
I expect many of us have some heavy patching to do this month. PHP devs refused to take the opportunity to break BC and fix the language/runtime with PHP5.
When will OpenJDK be usable serverside? I think I'd prefer to spend the month converting a bunch of PHP apps to Java instead of applying patches.
I've used PHP5 exclusively for over a year, for well-publicized reasons.
My turnips listen for the soft cry of your love
It's a legitimate question.
I just started using PHP a few months ago for a few utilities on one of my websites. There are a ton of things about the language that seem half-assed. In particular I'm thinking of:
- The entire mysql library, which I have to use right now because mysqli apparently isn't enabled by default in PHP 4 and my current host won't turn it on or upgrade to PHP 5. Why is the default behaviour to force the use of SQL injection-vulnerable code?
- There is no equivalent of a "contains" method for the string class, with strpos() being the recommended alternative. strpos() returns 0 if a string doesn't contain the specified substring... or it contains it at position 0. So to do a true "does this string contain some substring?" check requires using both strpos() *and* a separate check between the substring and a new substring made from the original string but chopped off at the length of the substring you're checking for.
- Dynamically-typed variables. Worst code/script idea evar. Yes, I realize PHP is not alone in this.
Basically to me it looks like the *ix version of VBScript. In its favour, it does use curly braces instead of MS' stupid "If something Then doSomeOtherThing End If" syntax.
"...always new atoms but always doing the same dance, remembering what the dance was yesterday." -Richard Feynman
DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL! DO NOT SAY PPL!
Lameness filter encountered. Post aborted!
Reason: Don't use so many caps. It's likeLameness filter encountered. Post aborted!
Lameness filter encountered.
Your comment violated the "postercomment" compression filter. Try less whitespace and/or less repetition. Comment aborted.
Reason: Don't use so many caps. It's like
Lameness filter encountered.
Your comment violated the "postercomment" compression filter. Try less whitespace and/or less repetition. Comment aborted.Lameness filter encountered. Post aborted!
Reason: Don't use so many caps. It's likeLameness filter en
Lameness filter encountered.
Your comment violated the "postercomment" compression filter. Try less whitespace and/or less repetition. Comment aborted.countered. Post aborted!
Reason: Don't
Lameness filter encountered.
Your comment violated the "postercomment" compression filter. Try less whitespace and/or less repetition. Comment aborted. use so many caps. It's li
I more and more get the feeling that the PHP developers themselves do not properly understand the vulnerabilities any more, which leads to improper and I even dare to say incompetent handling of reports and fixes (many of which simply get applied somewhere down the road without proper announcement or mentioning anywhere in the CHANGELOG) as well as seemingly ignorance regarding more complex vulns that are just as relevant as the glaringly obvious ones but simply not as mass-exploitable by script kiddies.
And *this* is the big problem that PHP is facing today regarding enterprise support. Maybe Jon Doe's blog installation is not as mass-exploitable by a script kiddie any more as it used to be some years ago, yet Big Company's CMS is still vulnerable to complex attacks by an experienced attacker who might use published attacks that security experts know about, yet end users do not.
:/- spoon(_).
Yes, but how many sites get hacked because of PHP and not because of faulty applications?
Not many.
A month of pointing out the ways PHP sucks ass? I predict roughly 97 million entries by the end of the first week.
I've found a very similar bug in GLIBC! This code will cause a segment violation!
Shock! Gasp! Horror!
I love PHP. It works, it's fast, it get results, it's everywhere, it has a straightforward syntax, it has a huge number of extensions enabling you to talk to just about anything, the online documentation is clear and present, it's free. You can write systems as simple or as complex as you like, you can write wholly procedurally or you can create classes and objects. That's why it's popular. No compiling, no fannying around with JVMs.
You use it, it works. You want to move your site/system to another platform? Just move it. Of course there are problems with things like verb-object, object-verb function naming, the object model is lacking, there are a plethora of similar functions, it can be a trial and error game to escape/unescape strings etc. But for the most part, for what most people want to do, these shortcomings are hardly insurmountable. Most people aren't using PHP to send rockets to Saturn or build massive projects where namespace size becomes an issue. Most people who use PHP have the intelligence to use it intelligently.
I've written some great, popular, scalable, applications in PHP4 and it was (and is) a pleasure. I cannot see why I should learn RoR, or Perl, when I have what works. Maybe somebody could explain why I should?
We see a lot of people use the phrase "defective by design" when talking about Vista and in that instance I'm pretty sure the use of the term is correct. Having never used PHP but heard of its many security problems I'm wondering: Is PHP defective by design?
Maybe. PHP is a wonderful interpreted language that makes creating a web application easy. The biggest problem with PHP are the entry-level programmers who don't understand the beast that is web programming.
Many PHP programmers don't understand the number one rule of secure web programming: All user data is evil. Anything that comes from an HTTP request can not be trusted. Heck, I don't trust it even after it has been stored in a database table or the file system. I would love to see a Perl-ish taint mode built into PHP that tells the programmer "This data has come from an insecure source. Please don't eval() it or unserialize() it or write it to disk. Cheerio."
Since properly coded PHP is still useful in many applications, what would be the best book to use as an up to date reference manual for the most secure method of coding with it?
Why not use a lovely PHP FrameWork then? Like, um, say, Drupal?
- - - -
You can't be ahead of the curve, if you're stuck in a loop.
You can't be ahead of the curve, if you're stuck in a loop.
Month of Shooting Fish in a Barrel
Seriously, when does the Month of Oracle Bugs make its return? Or did the Month of Bugs folks simply chicken out when Larry Elison showed up at their house with a samurai sword?
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
We can use Ruby on Rails.
perl is very good at text processing as well.
Are there any PHP-to-C++ translators? If the bugs are sitting in the PHP interpreter itself, it might be safer to translate and compile the code.
"Only perl can parse Perl" - but maybe there are alternative PHP parsers/interpreters?
That's Zonk's dream. He's probably whacking to the thought of that right now...
I have just analysed the last month's script kiddie attacks on my web server. 71% of them were to php-related URLs. When I first went through this exercise some years ago, the overwhelming majority of attacks were URLs related to IIS. The significance of this change cannot be overestimated.
l
Yes, a lot of the problems are sloppy coding, but too many are in the PHP core. How many web pages use the PHP-array-specific query-string
?foo[]=bar
- not many, you might think. How many use a PHP nested array
?foo[][][][][]=bar
- quite an unusual structure, you might agree.
The real stinger is that PHP will let this array be as deep as an attacker likes - and it's the same for a POST as for a query string, so there's no practical limit. An attacker can exhaust the space available for the stack, with several adverse consequences. This bug has a lot in common with the gravest bugs in PHP's history, in that it is a mistake in PHP's input processing: in this case, PHP trusts the sanity of user input. According to MOPB, Zend's attitude to this bug is "won't fix".
The arrogance of this attitude is breathtaking. PHP is now the most insecure package on my internet server, probably surpassing the old BIND 8 in the frequency and gravity of its exploitable bugs. I sincerely hope that Zend will get its act together and make security their number one priority. The predominance of PHP on the web is not theirs as of right - if they do not act, then either their product will be forked, or an alternative will take its place.
The nested array bug is described here:
http://www.php-security.org/MOPB/MOPB-03-2007.htm
I for one welcome our new month-of-bug overlords.
Do it yourself, because no one else will do it yourself. [beta blockade 10-17 Feb]
If you want to code well, you're best reading the Camel Book [sic].
You would hear of the many security problems of any language that's widely used in the internet. It's not that PHP is so insecure as that, the problem is that it's more exposed, so it needs to be more secure than other languages.
Part of the problem with the public image of PHP is that it's a purely "commercial" language, it lacks the nerdy appeal of Ruby or Lisp, for instance. Most of the comments you'll see here in Slashdot bemoaning PHP's shortcomings come from people like you, who never used PHP but are used to hearing about its security problems.
I use the language that's best for a given application. I use Perl to extract data from text files, Python for engineering programs, C for number crunching, PHP for getting user input in web interfaces, SQL to store the data. However, any time I try to explain here in
As the Month of Apple Bugs (as well as others) prove, OhitSuX appears to be defective by design.
MOAB proved security through obscurity is not security. I would look forward to a "Month of Linux Bugs"... but it seems EVERY month is given that honor.
How unethical is this!!! Here are the security problems with PHP. We have not reported all of them to the PHP people but we will fix it for you if you pay us. If not, well here is a nice encyclopedia of PHP problems for you bad guys to take advantage of. Sounds a bit like extortion to me.
PHP is a scripting language that can be run as either a CGI application or as an integrated Web server module. Regardless of its mode of execution, the PHP interpreter has the potential to access virtually every part of the host -- the file system, network interfaces and etc. Consequently, it has the potential to cause a lot of damage. The programmer needs to be aware of everything that can go wrong at any time during the program execution,in order to prevent attacks from adversaries. And yes this is a formidable task. Software getting so complicated very fast. But somehow, ussually knowledge about the weaknesses of a system and the common modes of attack can go a long way toward increasing its security. Same goes to any other piece of software.