News for hackers. Stuff that matters.
Re:Unauthenticated flag flipping yields remote code execution by gue5t on Wednesday April 11, 2018 @11:22AM (#16812028)
In short, ambient authority strikes again. Environment variables were a terrible design mistake in UNIX.
Re:Unauthenticated flag flipping yields remote code execution by jessaustin on Wednesday April 11, 2018 @11:34AM (#16812194)
If env vars didn't exist, the people who do the awful things described in TFA would still do those awful things. In fact the problems described there mostly took place when env vars were overridden by command line flags and unauthenticated web server requests.
Re:Unauthenticated flag flipping yields remote code execution by baud147258 on Wednesday April 11, 2018 @11:39AM (#16812237)
Environment variables are not the problem. It's environment variables with too much power and the possibility to change them remotely.
Re:Unauthenticated flag flipping yields remote code execution by hinkley on Wednesday April 11, 2018 @02:47PM (#16814174)
Being old enough to remember the special hell that was CGI, that particular mechanism showing up in 12 Factor Apps doesn't sit entirely well with me.

It doesn't stop me from supporting it as a deployment process, but there's a 22 year old inside of me that cries a little every time I talk about using environment variables for config.

Re:Unauthenticated flag flipping yields remote code execution by rainieri on Wednesday April 11, 2018 @01:02PM (#16813164)
Very vague post. Next time please write specific examples. Everyone should sanitize inputs.
Re:Unauthenticated flag flipping yields remote code execution by Analemma_ on Wednesday April 11, 2018 @01:13PM (#16813275)
> Everyone should sanitize inputs.

"Sanitize your inputs!" is the security equivalent of abstinence-only sex education. Yes, it technically will fix the problem if executed perfectly, but an endless history of failure should have convinced everyone by now that it is not the right solution for the real world. As other commenters have pointed out, shells were never designed with adversarial input in mind and so "sanitizing" them means hunting down and endless number of bugs and still not knowing if you've done it correctly.

The correct way is to design from the start so that user input cannot be executed. For SQL, everyone now knows that means parametrized statements; in this case, it means job queues and standalone processes with locked-down privileges.

Re:Unauthenticated flag flipping yields remote code execution by Karunamon on Wednesday April 11, 2018 @04:48PM (#16815448)
Ehh... how many instances of unsanitized input leading to RCE were due to the subtleties of the interpreter, and how many are the result of people blithely passing user input into the interpreter, not using the sanitation functions available in most mainstream languages (in many cases, in the standard library)?

If getting people to do this is impossible, so is getting people to stop storing passwords in plaintext.

Re:Unauthenticated flag flipping yields remote code execution by tomsmeding on Wednesday April 11, 2018 @05:36PM (#16815956)
> If getting people to do this is impossible, so is getting people to stop storing passwords in plaintext.

This may very well be the case, though. You may get most people to know that storing passwords in plaintext is not a great idea (tm), but there will always be people ignoring that, be it due to downright ignorance or external factors.

I can envision some non-technical person in an organisation prescribing to IT that a new user password cannot look like one of the user's old passwords, where "look like" actually means something like an edit distance of <=2. Since the secure way of implementing this is looping over all possible passwords close to the one the user entered now, hashing them all and comparing them to a list of past hashes (which is quite resource-intensive, which costs mony), I bet there will be people that will give in and just store the last few passwords in plaintext. Maybe they'll encrypt them, but they'll be there.

Re:Unauthenticated flag flipping yields remote code execution by stevekemp on Thursday April 12, 2018 @12:58AM (#16818126)
I can give you an example of somethign that is relatively common and "bad".

Imagine a website that will take an URL and extract the text from it - removing markup - or another service that will scan a URL for meta-tags, etc. All the kind of things that you can find easily.

Now imagine what happens if a user passes input such as "file:////etc/passwd". There are a whole bunch of services which will spit out the contents of the file, because they use some URL-fetching library and don't limit the protocols to http or https.

I wrote a blog-post about that, which was featured here a while back:

https://news.ycombinator.com/item?id=12478538

Re:Unauthenticated flag flipping yields remote code execution by hinkley on Wednesday April 11, 2018 @03:04PM (#16814375)
Yes except now I have 40 microservices that I have to make sure all parse URL parameters properly instead of the one I used to have that would parse them and then put them where everyone else could find it.

Security in depth is hamstrung by an ever-increasing surface area.

Re:Unauthenticated flag flipping yields remote code execution by sli on Wednesday April 11, 2018 @03:39PM (#16814721)
I'd say that if your microservices aren't sharing that type of code, you've probably made a software design mistake. Perhaps beside the point, but that's a bit of a contrived example.

I mean, people doing things wrong isn't evidence that they cannot be done right... right?