Remote Code Execution in AT&T
AT&T ran a version of Apache Struts 2 vulnerable to CVE-2017-5638, a server-side template injection flaw in the file upload interceptor. An attacker could send a crafted Content-Type header to execute arbitrary commands on the server.
Published on corben.io
I was pentesting AT&T to see if I could find a vulnerability (as one does), around 4-5 days after CVE-2017-5638 was released. Apache Struts 2 2.3.x before 2.3.32 and 2.5.x before 2.5.10.1 is vulnerable to Server-Side Template Injection, which allows attackers to execute commands on any vulnerable server.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The file upload interceptor in vulnerable Struts versions evaluated user-controlled input (the Content-Type header) as an OGNL expression, allowing arbitrary code execution.
Impact
An attacker could execute arbitrary commands on the server, potentially compromising AT&T's systems and affecting its hundreds of millions of customers.
What the attacker needed
Target runs vulnerable Apache Struts 2; attacker can send HTTP requests to the server
How it was found
- Search for AT&T URLs ending in .action using a Google dork.
- Pick a random .action URL and intercept its request in Burp Suite.
- Send the request to Repeater and insert a malicious OGNL payload into the Content-Type header.
- Send the request and observe that the command executes.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Apache Struts is a framework for building Java web applications. A bug in how it handled file uploads let an attacker sneak in a command through an HTTP header, and the server would run it. This meant someone could take control of the server without needing a password.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.