Live data from Hacker News

Remote Code Execution on a Facebook server

blog.scrt.ch

141–150 of 207 posts

Re: Remote Code Execution on a Facebook server

#141
post #55

Earlier quoted context omitted.

Of course. You can lock the process down so that it can't make unexpected system calls. If you deploy in a modern container environment, you can also use container networking to drastically limit what the application environment can talk to on the network. Though it's a less potent mitigation than seccomp and container isolation (and one you get for free once you deploy in a container), you can also limit filesystem…

> You can lock the process down so that it can't make unexpected system calls Huh, this isn't something I've ever come across before. Off the top of my head, I guess it would be possible on Windows using a kernel mode driver, but that's pretty hardcore, and really easy to get wrong. I know you can easily audit syscalls on Linux with auditd, but haven't seen preventing them before. Is this an option on both Linux and…

The Google search you're looking for is [seccomp docker].

(Docker is the most typical way this gets deployed but not the only way.)

Re: Remote Code Execution on a Facebook server

#142
post #126

So, summarily we have: 1. Enabling debug mode in production 2. Running publicly-accessible app with publicly-accessible crash screens without any monitoring system noticing it's happening 3. Relying on auto-cleaning in debug facilities to sanitize security information (never works) 4. Using over-powered serialization protocol which allows for code execution for storing user-accessible data 5. Thinking that merely sig…

Note that 5 is true though. Using a secret to sign or encrypt a cookie does normally work, and it's a common practice. Usually the impact of the secret leaking is that you can impersonate anyone, not that you can run arbitrary code, but the practice of using a session secret is common and not a bad practice nor broken inherently. 3 as well I think is unfair. That isn't something facebook implemented or is relying on;…

> Using a secret to sign or encrypt a cookie does normally work

If the secret key is not compromised. So you have to ask yourself - why you send to the user some info that is so sensitive that needs signing? Why not just keep this info to yourself and send an opaque ID instead? Yes, I know there are issues with it too, but at least this issue is not there.

> 3 as well I think is unfair. That isn't something facebook implemented

I didn't say it's Facebook fault - though ultimately, of course, it is as much as if you run certain software on your servers and do not configure it properly, it's your fault. So there's a fail in having security key in a place that's so easily accessible that debug mode dumps it without even asking. Not necessarily a direct Facebook fail, but a fail.

Re: Remote Code Execution on a Facebook server

#143

Earlier quoted context omitted.

I know this is going to get some jeering, but that's one nice thing about .Net's machine.config , 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…

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…

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

#144
post #125
post #118

Earlier quoted context omitted.

Memes are the next level, it seems

It certainly was in 1994. https://www.wired.com/1994/10/godwin-if-2/

An army of trolls that launch a fringe reactionary political movement which transcends the national boundary with postmodern "dank memes" seems to be the level we are at now. I wonder what's coming next...

Re: Remote Code Execution on a Facebook server

#145
post #73

Earlier quoted context omitted.

The point is, "for fun and profit" is such an overused and utterly boring cliché. Meaningful titles are pleasant to read and shows that the writer has put some effort to bring clarity into what they're trying to convey. (As someone who sits on a major open source conference talk panel, I cringe when I see one of these clichés slapped into the title without much thought. I politely suggest to rephrase to convey more "…

I'm in absolute agreement. Nerd-culture has been on autopilot for decades and needs to find its next level.

This is a really interesting topic to me, because I've felt a pull toward things like this myself and seen it for decades. For example, the top of the README in my Zephyros project[1] was very playfully done, and very well received too.

People are naturally more lighthearted and organic than the sterile software and documentation we tend to write, and we're more social too, wanting to connect with others even if it means through a simple in-joke or catch phrase.

[1] https://github.com/sdegutis/zephyros

Re: Remote Code Execution on a Facebook server

#146
post #111

Earlier quoted context omitted.

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.

This is really discriminatory and arrogant. I used to feel the same way. It’s worth changing.

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

#147

This is why you (looking at frameworks) should never use a format that may contain code to store data, especially when the client has control over that data (even if signed). The same vulnerability has occurred in almost every language/framework that does this, including Rails and Java-based ones. Just use something like JSON, which completely avoids code execution vulnerabilities like this. Except of course for the…

Yes, Django realized this 7 years ago [0], and JSON has been the default for the past 5 years[1], it's just that facebook was using an old version of Django, and probably not the default.

[0] https://groups.google.com/d/msg/django-developers/YwlZ9m9k1b...

[1] https://github.com/django/django/commit/b0ce6fe656873825271b...

Re: Remote Code Execution on a Facebook server

#148

This is a good example why you need regular pentests in big companies. Everyone (should) know that using pickle is insecure and everyone (should) know that django debug should be False in production. Still, if the numbers get large enough someone will miss something.

Facebook does pentests all the time, but they don't find everything. This is why you should also run a bug bounty program.

Re: Remote Code Execution on a Facebook server

#149
post #126

So, summarily we have: 1. Enabling debug mode in production 2. Running publicly-accessible app with publicly-accessible crash screens without any monitoring system noticing it's happening 3. Relying on auto-cleaning in debug facilities to sanitize security information (never works) 4. Using over-powered serialization protocol which allows for code execution for storing user-accessible data 5. Thinking that merely sig…

Note that 5 is true though. Using a secret to sign or encrypt a cookie does normally work, and it's a common practice. Usually the impact of the secret leaking is that you can impersonate anyone, not that you can run arbitrary code, but the practice of using a session secret is common and not a bad practice nor broken inherently. 3 as well I think is unfair. That isn't something facebook implemented or is relying on;…

Yes, and for #4, Django switched to JSON instead of pickle by default 5 years ago.
Post reply on HN