Live data from Hacker News

PHP-FPM remote code execution bug exploited in the wild

github.com

81–90 of 139 posts

Re: PHP-FPM remote code execution bug exploited in the wild

#81

I'm sure a lot of PHP 7.0 installations are still in production and will not receive a patch...

If you're using out-of-support version, you should either use a distro that backports patches or contract somebody to do the backports for you. Otherwise you're basically hanging a sign saying "please pwn me" on your site. This is true for any software, not just PHP (for PHP, most security fixes are actually not hard to backport, just somebody has to do it).

Re: PHP-FPM remote code execution bug exploited in the wild

#82

Earlier quoted context omitted.

Mailinabox as well.

According to [1] mailinabox seems to be not affected. [1] https://github.com/mail-in-a-box/mailinabox/issues/1663#issu...

Good news, and good to see them respond so fast as well. I looked through the config files (could not get the exploit to work for some reason) and found the exact offending lines and jumped to the wrong conclusion. Weird how the config appears to have the exact setup that NextCloud has and yet it does not seem to be exploitable. Wonder why that is.

Re: PHP-FPM remote code execution bug exploited in the wild

#83

Does anyone know if this exploit has any lasting effects? After this, you can start appending ?a= to all PHP scripts (you may need multiple retries). I'd love some way to confirm that my mitigations have worked and that I am no longer vulnerable but, y'know, running random slavic exploits against the server seems a bit sketchy.

If you are managing a php server and asking this question then you have bigger problems.

Re: PHP-FPM remote code execution bug exploited in the wild

#84
post #35

As good a time as any to be reminded.. if you have to run any kind of PHP app, always keep it in its own VM and preferably with no access to anything except its own databases, and ideally with minimal outbound Internet access. PHP security has improved markedly over time (especially app security, not just the runtime), but it's still.. well.. stuff like this. This time around I'm lucky that the sole app I run was usi…

You sound like PHP is somehow particularly bad in this regard. While this issue is nothing to be proud of, same kind of issues (and other RCE-causing issues too) are regularly found in many major products and libraries. There's no reason to specifically shame PHP for something that happens everywhere. Good defense is depth practices are always good idea, but no need to motivate it by casting PHP as some kind of particularly villainous.

Re: PHP-FPM remote code execution bug exploited in the wild

#85

My job used to include writing PHP webpages that were exposed to the internet, and looking after the webservers they were running on. I'm, not responsible for any public-facing webservers any more. My life is much better. [Edit: I reckon using a well-designed functional language might reduce the risk - like, PHP was never designed at all, it grew by accretion]

good for you mate.

Re: PHP-FPM remote code execution bug exploited in the wild

#86
post #53

Earlier quoted context omitted.

I hide mine behind letsencrypt, just dont put nextcloud.yourdomain.com but put it under a path like yourdomain.com/shortPhrase/nextcloud where shortPhrase is something like noway pizde and so on. Then dont share your links publicly.

How does Let's Encrypt "hide" anything? Quite the contrary—the list of certs granted is publicly available (as it is for all CAs, I believe).

Or use a wildcard cert.

Re: PHP-FPM remote code execution bug exploited in the wild

#87
post #84
post #35

As good a time as any to be reminded.. if you have to run any kind of PHP app, always keep it in its own VM and preferably with no access to anything except its own databases, and ideally with minimal outbound Internet access. PHP security has improved markedly over time (especially app security, not just the runtime), but it's still.. well.. stuff like this. This time around I'm lucky that the sole app I run was usi…

You sound like PHP is somehow particularly bad in this regard. While this issue is nothing to be proud of, same kind of issues (and other RCE-causing issues too) are regularly found in many major products and libraries. There's no reason to specifically shame PHP for something that happens everywhere. Good defense is depth practices are always good idea, but no need to motivate it by casting PHP as some kind of parti…

App security is still not on a par with other language ecosystems.. I don't think for example I've heard of a Python based SQL injection in many years. Stuff like that seems to still crop up regularly in PHP land

Re: PHP-FPM remote code execution bug exploited in the wild

#88
post #87
post #84

Earlier quoted context omitted.

You sound like PHP is somehow particularly bad in this regard. While this issue is nothing to be proud of, same kind of issues (and other RCE-causing issues too) are regularly found in many major products and libraries. There's no reason to specifically shame PHP for something that happens everywhere. Good defense is depth practices are always good idea, but no need to motivate it by casting PHP as some kind of parti…

App security is still not on a par with other language ecosystems.. I don't think for example I've heard of a Python based SQL injection in many years. Stuff like that seems to still crop up regularly in PHP land

Now you are confusing security of PHP as a platform with security of applications written in PHP. Python had 2 RCEs in 2018: https://www.cvedetails.com/vulnerability-list/vendor_id-1021... None in 2019 so far. PHP has none in 2018 and has one in 2019 so far (there's another one in http module but it's not part of the core).

> I don't think for example I've heard of a Python based SQL injection in many years. Stuff like that seems to still crop up regularly in PHP land

This is an extremely subjective statement based on your personal experience of what you heard and didn't. As such, it's not verifiable and not useful. What is useful is to know that, obviously, PHP, as well as Python, has SQL implementations that eliminate injections for decades. And as in Python, there could be people that ignore it and stuff query params directly into strings. This has nothing to do with anything but these people being ignorant. There are of course tons of web apps in PHP, much more than in Python, so among them inevitably would be crappy ones. If you run one of them, do take precautionary measures.

Re: PHP-FPM remote code execution bug exploited in the wild

#89

Earlier quoted context omitted.

It probably comes down to the environment for other work. If the company will "pay the price" then that's okay, but if you will "pay the price" i.e. if a need to nuke everything from orbit and rebuild from backup will simply result in a lot of unpaid overtime for you, that sucks, but in that case you might prefer to do less unpaid work in your off time today instead of more unpaid work in your off time throughout the…

Well sure, if restoring from backups means you will be working unpaid overtime then it'd be worth working less overtime to stave off more, but in practice restoring from backups is a time-consuming process for computers, not for people. Realistically though, enjoying your Sunday and digging into work issues on Monday is probably not going to be a big deal.

There's also the small issue that every minute that passes is another potential minute an attacker is stealing sensitive data, PII, and email/IM logs from your company's internal network, and backdooring other servers, installing ransomware, etc. That requires far more than a wipe and restore to deal with, and could potentially result in a massive financial and reputational loss.

Re: PHP-FPM remote code execution bug exploited in the wild

#90
post #40

My job used to include writing PHP webpages that were exposed to the internet, and looking after the webservers they were running on. I'm, not responsible for any public-facing webservers any more. My life is much better. [Edit: I reckon using a well-designed functional language might reduce the risk - like, PHP was never designed at all, it grew by accretion]

If anyone is following standard "recommended" practice, like in Nextcloud case, they get burned. This is true for all languages and frameworks. If you dont practice defense-in-depth, you get rekt eventually. I just checked my installation, its safe, since I didnt follow their "recommended" settings at all. Since its a PHP app, what I do is put an extra nginx proxy infront of it, so there is nginx 1 (this one runs in…

The recommended way off installing it uses apache instead of nginx, which happens not to be vulnerable.

Only if you looked up their instructions for nginx did you get burned.

Post reply on HN