Skip to content
RCE Write-up Beginner

Exploiting Spring Cloud Function Sqel injection — With Metasploit

Spring Cloud Function versions before 3.1.7 and 3.2.3 are vulnerable to remote code execution through a SpEL injection, tracked as CVE-2022-22963. An attacker who can reach the routing expression endpoint could run commands on the server and obtain a shell.

Rahul Kumar Follow

Published on systemweakness.com

Spring Cloud Function is a popular open-source framework that allows developers to create serverless applications in a variety of programming languages. However, like any software, it’s not immune to vulnerabilities that could be exploited by attackers.

Rahul Kumar, on systemweakness.com

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 the routing expression supplied in the request was evaluated as a SpEL expression without sanitisation, allowing arbitrary code execution.

Impact

A successful exploit gives the attacker a shell on the target, which could lead to full compromise of the server.

What the attacker needed

Target runs vulnerable Spring Cloud Function; network access to the service; Metasploit installed

How it was found

  1. Confirm the target application depends on Spring Cloud Function.
  2. Start Metasploit with msfconsole.
  3. Select the spring_cloud_function_spel_injection exploit module.
  4. Set the target host and your listener host in the module options.
  5. Run the exploit.
  6. Receive a shell if the module succeeds, changing the payload if it fails.

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 Cloud Function is a Java library for building small serverless functions. It accepted a routing expression from the request and evaluated it as a SpEL expression, which is a small scripting language inside Java. Because the expression was evaluated, an attacker could make the server run their own commands instead of just routing a request.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Rahul Kumar

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.