Exploiting Expression Language Injection to CVE-2024–51466
An unauthenticated endpoint in IBM Cognos passed user input into a Java Expression Language (EL) expression, allowing an attacker to execute arbitrary system commands on the server. The author chained this with another vulnerability to bypass authentication, achieving unauthenticated remote code execution.
medium.com
Published on medium.com
Expression Language (EL) allows JSP pages to easily access application data stored in user-defined JavaBeans components as well as the implicit objects. In addition, JSP pages can also invoke arbitrary public and satic methods and perform arithmetic operations using EL expressions.
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
Likely, user-controlled input was evaluated as an EL expression without sanitisation, allowing arbitrary Java method invocation.
Impact
An unauthenticated attacker could execute arbitrary Java code and system commands on the server, leading to full remote code execution.
What the attacker needed
Network access to the endpoint; no authentication required
The fix
The vulnerability was fixed by IBM, as acknowledged in the report.
How it was found
- Send a request to the endpoint with a simple arithmetic EL expression to see if it is evaluated.
- Use a string replacement EL expression to confirm it is EL injection rather than SSTI.
- Enumerate Java classes and methods to find a way to execute commands.
- Invoke Runtime.exec() with a command that sends a request to an outbound server to confirm execution.
- Use PowerShell on the Windows backend to send the output of a command to the outbound server.
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.
Expression Language (EL) is a way for Java web pages to run small expressions, like doing maths or calling methods. If a website takes input from a user and puts it directly into an EL expression, an attacker can make the server run their own code. Here, that let the attacker run system commands on the server without logging in.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.