Apache Struts is a well-known development framework for Java-based web applications that is mostly used in enterprise environments. If you search for Apache Struts CVEs on MITRE, you currently get 77 results, and most of the critical ones are due to OGNL expression injection, which is very similar to SSTI (Server Side Template Injection) attacks.
In this article we will go through the security history of Apache Struts, common Apache Struts security issues and the impact of these vulnerabilities.
Recent history of Apache Struts
Apache Struts have a rough security history with many critical vulnerabilities and because of these, the infamous Equifax hack was made possible as CVE-2017-5638 was mainly used to get hold of million records of creditholders’ data. Apache Struts have not only suffered from OGNL expression injection vulnerabilities, but also deserialization.
Object-Graph Navigation Language (OGNL) is an expression language for handling Java objects. When an OGNL expression injection vulnerability is present, it is possible for the attacker to inject OGNL expressions. These expressions can execute arbitrary Java code.
Searching for this vulnerability in a black box environment is easy, and have the same approach as searching for SSTI vulnerabilities. We can inject OGNL expressions in all user supplied data fields and see if we get any response back indicating that the expression has been handled and executed on the server.
Watch this Proof of Concept video to see how CVE-2o17-9791 can be exploited:
An example of an expression to use could be as simple as:
foobar%{191*7}
where %{191*7}is the expression. The output from this would be 1337. These expressions can of course be something other than just mathematical, but this is a way to easily detect the vulnerability.
How Detectify can help
Detectify can test against generic OGNL expression injections in Apache Struts, but also many of the known CVEs. Check your web applications against known Apache Struts vulnerabilities and more. Start your 2-week free trial today.
Applications have long evolved from monolithic structures to complex, cloud-native architectures. This means that the tried-and-true methods we rely on are becoming dangerously outdated. For …
This comparison focuses on how Holm Security and Detectify address the core challenges faced by AppSec teams: gaining visibility and context, testing their web applications …
Welcome to The researcher’s desk – a content series where the Detectify security research team conducts a technical autopsy on vulnerabilities that are particularly interesting, …
Welcome to The researcher’s desk – a content series where the Detectify security research team conducts a technical autopsy on vulnerabilities that are particularly interesting, …