Slashdot Log In
Month of PHP Bugs Has Begun
Posted by
Zonk
on Sat Mar 03, 2007 01:28 PM
from the quick-hide-the-furniture dept.
from the quick-hide-the-furniture dept.
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.'"
Related Stories
[+]
March To Be Month of PHP Bugs 292 comments
PHP writes "Stefan Esser is the founder of both the Hardened-PHP Project and the PHP Security Response Team (which he recently left). During an interview with SecurityFocus he announced the upcoming Month of PHP bugs initiative in March." Quoting: "We will disclose different types of bugs, mainly buffer overflows or double free (/destruction) vulnerabilities, some only local, but some remotely triggerable... Additionally there are some trivial bypass vulnerabilities in PHP's own protection features... As a vulnerability reporter you feel kinda puzzled how people among the PHP Security Response Team can claim in public that they do not know about any security vulnerability in PHP, when you disclosed about 20 holes to them in the two weeks before. At this point you stop bothering whether anyone considers the disclosure of unreported vulnerabilities unethical. Additionally a few of the reported bugs have been known for years among the PHP developers and will most probably never be fixed. In total we have more than 31 bugs to disclose, and therefore there will be days when more than one vulnerability will be disclosed."
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Defective by Design? (Score:5, Interesting)
(http://www.ckwop.me.uk/)
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
Re:Defective by Design? (Score:5, Informative)
It was. A lot of work has been done in the last couple of major versions to fix this, but still a lot of installations are crippled in the name of backward compatibility.
Most of what we're seeing here though is just run-of-the-mill sloppy coding. Create a lot of references to a variable and overflow its (16-bit) reference count? Please. That should never have happened.
Fortunately, it seems most of the bugs released so far don't affect the majority of installations. We have a number of 'executing arbitrary PHP code can let somebody own your web server' -- well, most of us don't let random people run arbitrary PHP code anyway. We have some 'deserialising arbitrary data can let somebody own your web server' issues too, but then there has been a long-standing warning that PHP's deserialise function isn't secure anyway, so that shouldn't affect anyone who's been paying attention. We have some issues with the Zend Platform, but I'm not sure how many people have that installed. So far, the only issue to affect me, is the phpinfo XSS vulnerability -- and that just meant I had to delete my phpinfo.php file that I kept in the root of each domain I host.
Re:Defective by Design? (Score:5, Interesting)
How I wish we could just junk the language and start again with something else; unfortunately, market pressures being what they are, I'm afraid we're stuck with it, at least for the time being.
Re:Defective by Design? (Score:5, Interesting)
Re:Defective by Design? (Score:5, Insightful)
It may never completely go away, but there are alternatives to using it.
Re:Defective by Design? (Score:5, Informative)
if you left an open phpinfo() on your server (giving potential attackers access to filepaths, module version numbers, configuration options, apache server configuration options), you have a lot more to worry about than a little XSS.
unfortunatly, you're not alone [google.com].
Re:Parent isn't flamebait (Score:5, Interesting)
strpos() return FALSE when it can't find the 'needle'. http://us2.php.net/strpos [php.net] Use a proper test (===) and you'll have all you need in a single statement.
Some people really LIKE dynamically-typed variables. It's not a bug or a problem. It's a design choice.
Your flamebait at the end (vbscript) does nothing to enhance your argument. Leave it off next time.
Re:Defective by Design? (Score:5, Funny)
Month of bugs, will it change things for better? (Score:4, Interesting)
(http://www.chabotc.nl/)
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
Just in case.. (Score:4, Interesting)
(http://www.loconet.ca/)
vulnerable (Score:1)
Typical (Score:3, Informative)
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.
Don't beleive it (Score:1)
(Last Journal: Tuesday February 11 2003, @02:45PM)
Not many.
Oh Nose! (Score:4, Funny)
I've found a very similar bug in GLIBC! This code will cause a segment violation!
Shock! Gasp! Horror!
PHP taint what it should be (Score:2, Insightful)
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."
Re:PHP taint what it should be (Score:4, Interesting)
(http://www.gravit-e.ca/)
Be Prepared? (Score:2, Insightful)
Why not use a lovely PHP FrameWork then? (Score:1)
(http://www.theirc.org/)
Why not use a lovely PHP FrameWork then? Like, um, say, Drupal [drupal.org]?
- - - -
You can't be ahead of the curve, if you're stuck in a loop.
Next Month... (Score:2)
(http://blog.bfccomputing.com/ | Last Journal: Tuesday August 07, @06:50PM)
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?
Is there an alternative? (Score:1)
(http://freeshells.ch/~bsah/)
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?
Why MOPB Matters (Score:2, Interesting)
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
Programmers need to be aware (Score:1)
Re:Month of PHP Bugs Has Begun... (Score:2)
Re:Er... (Score:1)
(http://www.s5h.net/)
Re:die PHP die (Score:1)
(http://www.s5h.net/)
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.
Re:In defence of PHP (Score:1)
(http://kozo.apparitiondesigns.com/)
Re:In defence of PHP (Score:2)
(http://wakaba.c3.cx/)
Because it is painfully obvious that you have no idea what you are doing, and thanks to PHP's lack of secuirty measures against inexperienced programmers, you are very likely creating tons of highly vulnerable programs.
Other languages tend to have much more secure APIs, letting you get away with not paying as much attention to security. Do yourself a favour and switch to one of them.
Re:In defence of PHP (Score:1)
(http://damac.us/)
Next, 120% slower under [undisclosed] circumstances. Browser rendering, network setup, capabilities of server/client, will impact things.
Additional, and this also relates to your 3rd point, there are are wide variety of PHP accelerators [wikipedia.org] which give PHP quite a speed boost. From Wiki: Most work by caching the compiled bytecode form of PHP scripts to avoid the overhead on every page request of parsing and compiling source code that may never even get executed. For best performance, caching is to shared memory with direct execution from the shared memory and the minimum of memory copying at runtime. A PHP accelerator typically reduces server load and increases the speed of PHP code anywhere from 2-10 times[...]
And yeah, PHP's fast and loose flexibility creates the necessity for things like === however the requirement that one is more aware of how types are handled is easily outweighed by the flexibility it gives the developer and the ease of use.
Re:In defence of PHP (Score:2)
The really big thing that PHP gets right - and it's so big that people often don't even see it - is that deployment is really, truly, brain-dead simple. Write some code, drop it in a folder, and it just works. You *really* can't say that about Rails, where you can about, say, CakePHP. This is mainly because Rails isn't internally thread-safe, but that's only a problem because mod_ruby uses a single instance of the interpreter for all requests. That makes mod_ruby a distinctly unpopular deployment target for Rails.
For smaller, non-Rails projects, Ruby can be a good option if simplicity of deployment is paramount, but as far as I know it's rather uncommon.
Re:Er... (Score:1)
(Last Journal: Sunday June 17, @02:35AM)
Re:In defence of PHP (Score:2)
And I did a lot of testing in my company that showed that programming large html sites with database content in java is 5000% slower than in PHP.
No, I don't consider it fun either. OTOH, it's very quick and trivially easy, so that makes the lack of fun doing it irrelevant.