We have other clients who won't leave their host, and we're locked to PHP 5.2 to try to "write a modern application" in.
The bleeding edge may not be safe, but staying locked to an ancient copy of PHP 5 that was end-of-lifed years ago is not a smart idea.
That's probably not as bad as you make it out to be. CentOS 5.x is supported through 2017 with security patches, as would be CentOS/RHEL's customized PHP package. You don't get the new features, but you get the back-ported security fixes.
And if you want a newer version of PHP, you can always use IUS Community's repos[1]
> The IUS Community Project is a brain child of the RPM Development Team at Rackspace Hosting. Since 2006, we have provided and maintain packages for the latest versions of PHP/MySQL and other common software on Red Hat Enterprise Linux, because a lot of our customers strongly demand it. Internally we maintain a number of package sets for an audience of thousands of production servers. Until now, these packages have only been available internally to Rackspace customers. After a while we started thinking: Why not make this available publicly for everyone to benefit?
It should be expected that the same mindset would lead to unpatched servers and inattention to the nuances of the stack.
I wouldn't the cause of this unpatched server to inattention. More like bureaucracy and a bad case of "too many cooks in the kitchen".
I've come to the conclusion that inertia is the most powerful force in business.
As for supporting 5.2, I think people should start plain refusing to support outdated versions and educate their clients that running this version puts their business at risk. Unless there's super-important reasons for it (like the only supported PHP version for PrivateWeirdOS is 5.2 and nobody can port any supported version to it because the effort takes years), there should be no development targeting version that was EOLed 4 years ago.
The existing security holes in their code are going to be given equal weight with these concerns. Now unless you know what their bugfix backlog is, there's no reason to think security upgrades are a bigger priority than say PCI audits or whatever.
Unless there's a demonstrable value to fix this OVER all other security issues, only then would it make sense to hustle with a emergency fix.
And the thing about emergency patching is that you can't just toss your "solution" into the product. At the very starting line of sanity you need to research the risk an upgrade will have on your system. Don't think of the environment the system is hosted on, but the code itself.
That takes someone really smart and expensive to get pulled off whatever they were working on that generates money and focus on this security issue (over all others). They research, document and propose an upgrade path. Code will need to be refactored, tested system wide and then QA/UAT will chew on it. Data may need to be migrated or transformed (in production, risky!).
And that's all if they know the right way to do it! If you're unlucky you get a panicking CTO or boss who (read this article on hacker news and) demands a quick fix. In that case you upgrade the server, throw code up and fix related bugs for months. Who knows, maybe none of them will be security holes!
Edit: I don't know if I can reveal the client, so please don't ask.
However, it's interesting data of what's out there so thanks to the author for that. Most of the infections we see are default installations that haven't been configured and a bot raced in and infected. Or old PHP apps, themes, plugins or components like thumbnailers that were the vector. Targeting PHP itself is quite rare because there are so many vectors via the PHP applications themselves that it's not needed if you just want to own a few thousand boxes for your botnet.
Supported versions of PHP with their timelines: http://php.net/supported-versions.php
Unsupported versions of PHP with EOL dates http://php.net/eol.php
Total number of servers running PHP: 7,320,803 https://www.shodan.io/search?query=php+port%3A80%2C443%2C808...
Servers running vulnerable PHP versions: 4,111,345 https://www.shodan.io/search?query=php+port%3A80%2C443%2C808...
At the same time many, many many linux servers are never updated after the first installation...
Now I'm at a place that has VERY loosely managed code where they virtually cannot upgrade some sites without a rewrite. They're on an old version of PHP 5.2 and MySQL 5.0. I'm doing all I can to get everyone there to understand the issues with legacy software, but it's a tough battle. Thankfully, I've got new code and features running the latest PHP and MySQL versions, it'll be several (many) years until all of it's managed enough to be upgradable.
I can also say I've always thought the PHP complaints were unfounded -- no real company doesn't understand OOP, datatypes, etc. Yeah... I completely understand now. It's a fun challenge putting good, solid standards in place and moving a horrid codebase into a great one, though.
So is it just me, or is this a total release management failure that there can be multiple different things called "PHP 5.3.3" (or any other version number), which behave differently, some of which have security vulnerabilities and some don't.
If you want to know if you are vulnerable or not, knowing you have "PHP 5.3.3" is not enough -- I'm not even sure how you'd tell if you had a patched version or a non-patched version, other than testing it for vulnerability.
Something seems horribly wrong here, no?
Yes. The distributions are effectively forking these versions, and keeping the same version numbers. Leading to some REALLY awkward problems: https://github.com/ircmaxell/password_compat/issues/10
However, it's a tradeoff. It hurts some, helps others. After all, I'd rather have someone get security fixes than nothing...
It's quicker for distros to backport specific security fixes than to test all the compatibility implications of updating the whole package to the latest version.
I wouldn't be surprised is the Linux distributions that these sites run on have just as many vulnerabilities if you use the same criteria as presented here.
I'm not aware of any major applications (WordPress, Drupal, etc) that deserialize user input. That's not to say a plugin or theme might be unsafe, but not in the core code that I've seen.
Does every release fix security vulnuerabilities?
So for PHP's 5.6 line, only 5.6.4 is secure, since 5.6.4 is a security release.
I'm currently crunching numbers for other platforms. For example, Nginx's last security release (for 1.7) was 1.7.5, so 1.7.5 -> 1.7.9 are all considered security.
Note that this list refers to those versions as released, not as OS vendors may have patched them.
But don't take my word for it... http://php.net/ChangeLog-5.php
At least 90% of releases have a bugfix with an associated CVE vulnerability.
The myth that PHP has some special bad security profile is completely baseless. It is true that there's a lot of insecure software written in PHP, but the reason has nothing to do with security of PHP as a platform, but rather with its low learning curve, which makes it popular among the same people that make security mistakes - the beginners. They don't make insecure software in Haskell not because Haskell is so secure that you can't write insecure software in it, but because they can't write any software in Haskell at all.
Dropping PHP in this case is a cargo cult - you do not improve your security situation by just mimicking people that made better security decisions in aspects that have nothing to do with security. It's like stopping eating bananas because your neighbor slipped on a banana peel and broke his neck, all while keeping smoking and eating junk food. Replacing negligible risk with another negligible risk while keeping very risky habits would not reduce your overall risk.