Mitigating Universal Ruby RCE Deserialization Gadget with Advanced WAF

A new article was recently published by vakzz regarding the latest version of a known Universal deserialization gadget for Ruby 2.x-3.x 

OWASP Deserialization Description:

"Data which is untrusted cannot be trusted to be well-formed. Malformed data or unexpected data could be used to abuse application logic, deny service, or execute arbitrary code when deserialized."

It is often convenient to serialize objects for convenient communication or to save them for later use. However, deserialized data or code can often be modified without using the provided accessor functions.

The published gadget is universal, meaning it will only depend on the existence of classes that are shipped with the default installation of Ruby. Thus, it will be able to execute arbitrary code in any Ruby application. In recent years many gadgets were discovered that allowed to hack the Ruby-based applications that later were patched.

In the new article, the Universal gadget is relevant to a vulnerable application based on the Ruby on Rails Web framework that deserializes User Input via the Marshal.load”  class method.

The new universal gadget uses a new chain consisting of both previously known classes and unique ones that have not been encountered before:


The following request was sent to a Ruby-based web application using the described gadgets:


Mitigation with BIG-IP Advanced WAF

Advanced WAF customers under any supported BIG-IP version are already protected against this vulnerability. The exploitation attempt will be detected by existing Ruby Universal Deserialization Gadget attack signatures, which can be found in signature sets that include the "Server-Side Code Injection" attack type or "Ruby" System.

The specific signatures:

       200004478, 200004479, 200004480


We will also be releasing a more accurate signature to detect this specific new gadget.

Relevant links:



Published Jan 11, 2021
Version 1.0

Was this article helpful?

No CommentsBe the first to comment