News for hackers. Stuff that matters.
Re:Remote Code Execution on a Facebook server by Areading314 on Friday August 24, 2018 @10:34AM (#17835139)
This is a great concrete example why you should never run debug mode on a public server. Django can only do so much for redacting private info. This is also a great example of how insecure pickle is!
Re:Remote Code Execution on a Facebook server by ssebastianj on Friday August 24, 2018 @10:41AM (#17835187)
Luckily, Django provides checks to avoid this kind of leakage before hitting production with https://docs.djangoproject.com/en/2.1/howto/deployment/check...
Re:Remote Code Execution on a Facebook server by deusofnull on Friday August 24, 2018 @12:03PM (#17835777)
And to be fair, the docs are littered with warnings about not using debug mode in production. Debug mode is open for.... debugging. not production.
Re:Remote Code Execution on a Facebook server by misiti3780 on Friday August 24, 2018 @11:10AM (#17835396)
wow thanks - just ran this on some production servers and caught some intersting stuff! had no clue this command existed.
Re:Remote Code Execution on a Facebook server by 5h on Friday August 24, 2018 @12:02PM (#17835769)
They were running django 1.6 ....
Re:Remote Code Execution on a Facebook server by js2 on Friday August 24, 2018 @07:04PM (#17838462)
Re:Remote Code Execution on a Facebook server by Someone1234 on Friday August 24, 2018 @11:10AM (#17835393)
I know this is going to get some jeering, but that's one nice thing about .Net's machine.config <deployment retail="true" />, you designate the machine itself as a non-development environment and tracing, debug output, and so on are disabled for all .Net/ASP.Net applications.

That might not work for all edge cases, but broadly there's a lot of machines which are only for non-development/production code, and a system-wide setting makes you a lot safer.

Re:Remote Code Execution on a Facebook server by kawsper on Friday August 24, 2018 @11:47AM (#17835655)
Funnily enough, it is mostly .NET applications running in production that I see stack-traces from these days.
Re:Remote Code Execution on a Facebook server by Someone1234 on Friday August 24, 2018 @01:03PM (#17836177)
If you even know something is a .Net app then the developer is likely terrible, so it is a self-selecting sample. You don't know most of the .Net MVC apps you interact with because there's no reason to know that.
Re:Remote Code Execution on a Facebook server by tedunangst on Friday August 24, 2018 @08:32PM (#17838839)
Boy, getting hammered for poor phrasing. What's meant is if the stack (whatever it is) bleeds into the user experience, the dev has done a poor job.
Re:Remote Code Execution on a Facebook server by shawn on Friday August 24, 2018 @01:47PM (#17836491)
This is really discriminatory and arrogant.

I used to feel the same way. It’s worth changing.

Re:Remote Code Execution on a Facebook server by alexbecker on Friday August 24, 2018 @04:15PM (#17837585)
I think they mean if you can tell that it's a .NET app (e.g. because they left the X-Powered-By header on), not if it's a .NET app in general.
Re:Remote Code Execution on a Facebook server by shawn on Friday August 24, 2018 @06:05PM (#17838162)
Facepalm. I've filled my dumb comment quota for the week.

Well, at least it was clarified. It got a couple upvotes, so I guess others misinterpreted it too. Sorry.

Re:Remote Code Execution on a Facebook server by detaro on Friday August 24, 2018 @02:14PM (#17836708)
That's true for basically every stack
Re:Remote Code Execution on a Facebook server by lojack on Friday August 24, 2018 @11:07PM (#17839308)
> If you even know something is a .Net app then the developer is likely terrible

For sake of argument, this is pretty easy to do just by looking at job postings.

Re:Remote Code Execution on a Facebook server by tomazio on Friday August 24, 2018 @02:25PM (#17836793)
Ever heard of Jon Skeet?
Re:Remote Code Execution on a Facebook server by bpicolo on Friday August 24, 2018 @11:26AM (#17835501)
You can use env vars to do similarly for all the big frameworks (django, rails, etc)
Re:Remote Code Execution on a Facebook server by gandreani on Friday August 24, 2018 @11:30AM (#17835534)
Just a thought. This might actually be trivial to implement in a unix environment from the administration side of things. I'm not 100% sure but all child processes inherit the env vars from the parent correct? So setting `environment=production` high up in the process tree should make it available to all processes.

There's still chances of this getting overridden down the line and all apps have to conform to one style but at least it's possible?

Re:Remote Code Execution on a Facebook server by Someone1234 on Friday August 24, 2018 @11:37AM (#17835581)
Absolutely. But none of the major players are looking for it, and they all have unique ways of designating the machine that way.

There's no specific technological challenges, this is entirely political, getting half a dozen or more different projects with different priorities to check the same variable for the same purpose.

Re:Remote Code Execution on a Facebook server by phinnaeus on Friday August 24, 2018 @11:50AM (#17835679)
Plenty of production apps in my line of work are executed with `env -i` for consistency.
Re:Remote Code Execution on a Facebook server by wereHamster on Friday August 24, 2018 @12:59PM (#17836151)
I don't know what the standard way is to deploy django or .net apps, but nodejs apps are often packaged into a docker container, or cloud function, that run independently, not on any particular machine that you designate as 'production'. So 'system-wide' settings don't really exist because there is no concept of a machine.

With nodejs in a docker contianer for example you specify whether the server is designated for production or not during build time, not when you run it.

Re:Remote Code Execution on a Facebook server by panopticon on Friday August 24, 2018 @03:58PM (#17837483)
I think you're a little over-confident in the Node community; I've seen a lot of Node apps deployed the same as any other (just tar'ed up and deployed via some kind of script or other deployment tool).
Re:Remote Code Execution on a Facebook server by tluyben2 on Friday August 24, 2018 @08:52PM (#17838937)
Seems a bit of the HN echo chamber; people here seem to think, because of the high quality stories and comments, that the entire world uses best practices for everything; containers, code reviews, versioning, test coverage, CI, automated deployments, etc. While in reality I think most places are not doing that. This is anecdotal ofcourse but most (large and small) companies I have worked with (as clients or partners) are in fact doing none of these things.
Re:Remote Code Execution on a Facebook server by pjmlp on Sunday August 26, 2018 @08:18AM (#17845604)
Quite true. I hardly see any of the best practices that keep being discussed here.

Small to middle size companies whose main business is totally unrelated to selling software just care that their stuff works somehow. And everything that IT does is a cost center.

Re:Remote Code Execution on a Facebook server by GordonS on Friday August 24, 2018 @03:39PM (#17837331)
I guess that's .NET Framework only - is there something similar for .NET Core?
Re:Remote Code Execution on a Facebook server by buster on Friday August 24, 2018 @02:13PM (#17836693)
Exactly.. i think you often see a warning about pickle when it comes to safety. For example, the current documentation has a big, red warning right at the top: https://docs.python.org/3/library/pickle.html

The Django project also has a lot of warnings about the pickle serializer: https://docs.djangoproject.com/en/2.1/topics/http/sessions/

Re:Remote Code Execution on a Facebook server by rrcaptain on Friday August 24, 2018 @05:05PM (#17837886)
I think maybe frameworks should stop calling it debug mode and start calling it "danger mode". Because clearly people aren't paying attention to what it actually does.