Learning About spring4shell Exploit
The Spring Framework's data binding allowed an attacker to manipulate the class loader through request parameters, enabling remote code execution. An attacker could write a JSP webshell to the server and execute arbitrary commands.
Published on systemweakness.com
I’m pretty sure you might have heard about the infamous “Spring4Shell” exploit by now, so rather than boring you with the details about how it was discovered or how to exploit it. I’d like to explain how and why it works.
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
Impact
An attacker could execute arbitrary commands on the server, leading to full compromise.
What the attacker needed
Vulnerable Spring Core version; endpoint with a POJO parameter
How it was found
- Send a request to a vulnerable endpoint with parameters that set the Tomcat access log pattern, suffix, directory, prefix and fileDateFormat.
- The server writes a JSP webshell file into the web application's root directory.
- Request the newly created JSP file with a password and command parameter to execute commands.
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.
Spring is a popular Java framework for building web applications. When a user submits a form, Spring automatically fills in a Java object with the submitted values. The bug let an attacker supply special parameter names that reached deep into the server's internals and let them run their own commands.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.