Facebook Server RCE Vulnerability Disclosed

A researcher, Daniel Le Gall, has uncovered a serious vulnerability in one of Facebook’s servers. The researcher found a Sentry service hosted on with the hostname sentryagreements.thefacebook.com, while scanning an IP range that belongs to Facebook -

Remote Code Execution on a Facebook Server: Technical Details

What is Sentry? It is a log collection web application which is written in Python with the Django framework.

The researcher also explained that, while he was looking at the Sentry app, some stracktraces regularly popped on the page for no particular reason.

The application seemed to be unstable regarding the user password reset feature, which occasionally crashed, he added, noting that Django debug mode was not turned off, which consequently prints the whole environment when a stacktrace occurs.

However, Django snips critical information (passwords, secrets, key…) in those stacktraces, therefore avoiding a massive information leakage.

The researcher decided to look closer, and realized he could spot session cookie names, various options, as well as serializer known as Pickle. Simply put, Pickle is a binary protocol for (un)serializing Python object structures, such as classes and methods in them.

If we were able to forge our own session that contains arbitrary pickle content, we could execute commands on the system,” Daniel noted.

Nonetheless, the SECRET_KEY used by Django for signing session cookies is not available in the stacktrace. Furthermore, the SENTRY_OPTIONS list contains a key named system.secret-key, that is not snipped. According to the Sentry documentation, system.secret-key is “a secret key used for session signing. If this becomes compromised it’s important to regenerate it as otherwise its much easier to hijack user sessions.“

As the researcher pointed out, it looks like that the situation is “a sort of Django SECRET-KEY override (Read more...)

*** This is a Security Bloggers Network syndicated blog from How to, Technology and PC Security Forum | SensorsTechForum.com authored by Milena Dimitrova. Read the original post at: https://sensorstechforum.com/facebook-server-rce-vulnerability/