News for hackers. Stuff that matters.
Re:PHP Built-In Web Server by onion2k on Monday August 24, 2020 @02:50AM (#24258082)
I have an absolute hatred of putting unused code on a production server, especially if it's something that can listen to network traffic. It's such an unnecessary risk. The fact that you don't appear to be able to set PHP up in a way that disables the use of this thing feels horrible. There's no way I'd ever want to run PHP outside of a container that I have control over which few ports are mapped to now.
Re:PHP Built-In Web Server by Sysosmaster on Monday August 24, 2020 @03:35AM (#24258265)
This is only present in the CLI builds of php, And you should limit who can run the php scripts anyway on a production server.

Remember that setting up a reverse shell only requires a networkable shell (like bash). Most linuxes (including containers) there for have the capability of having reverse shells started on them. The way to protect abuse of PHP’s webserver function is the same as the one to protect against bash reverse shells. Do not allow any outbound traffic but only traffic you trust!

Do not blame php for having a feature that others have had for years. PHP’s version is no better or worse than any of them.

Re:PHP Built-In Web Server by zuppy on Monday August 24, 2020 @03:07AM (#24258165)
honestly, I would never run anything important in production that's not behind a load balancer+firewall, so without direct internet access. it helps with upgrades, as you can upgrade separately each node without putting down the application and it provides security because you only whitelist what you want to give external access (yes, I know there are still other attacking vectors, but still, security is an incremental job that adds on layers and layers of best practices)
Re:PHP Built-In Web Server by 7demons on Monday August 24, 2020 @03:05AM (#24258151)
Time to take some medication maybe? Such hatred against programming language is not normal.
Re:PHP Built-In Web Server by onion2k on Monday August 24, 2020 @03:23AM (#24258227)
I don't hate the programming language. PHP is a great language that I used for a decade before moving over to the frontend. I don't use it any more but I work in a company that does and I see good results when it's deployed. This is not about PHP (or Python, or Ruby, as they also have built-in httpd servers).

What I hate is the idea of putting something on a server that's going to make my life harder, or create more work for my team. I don't want the developers I work with having to give up their evenings or weekends to resolve issues and incidents that arose from things shouldn't have existed in the first place. That's why I don't want additional network services sneaking their way on to production. I should very easily be able to tell which applications on a server are listening to external traffic.

Maintaining good security is hard enough without language runtimes including things that should strictly only ever be a development dependency rather than a production dependency.

If there are pills I can take to make this problem go away, sign me up.

Re:PHP Built-In Web Server by Sysosmaster on Monday August 24, 2020 @03:40AM (#24258292)
How does a feature of the Command line version of php impact developers? Developers should not run applications on production machines themselves (either its a script, a deployement agent / engine or a operations guy that does that work (including devops guy with operations)).

As for security you must keep up with the capabilities of the tools you use. Php has been able to run as a webserver for years (even before 5) all they did is implement a good sane dev server to run php code without setting up a complex php environment (that is probably less secure).