Skip to content
RCE Write-up Intermediate

Inside CVE-2022–22963: Exploring a Critical Spring Cloud Function Vulnerability

Spring Cloud Function mishandled the spring.cloud.function.routing-expression HTTP header, allowing injection of a SpEL expression. An attacker could achieve arbitrary command execution on the affected system.

Lwanyagaivan Follow

Published on medium.com

A small weakness in how an application processes input can create a serious security risk. CVE-2022–22963 is a critical vulnerability in Spring Cloud Function that can allow remote code execution under affected configurations.

Lwanyagaivan, on medium.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

The application evaluated the attacker-controlled routing-expression header as a Spring Expression Language expression without adequate safeguards.

Impact

An attacker could execute arbitrary commands with root privileges inside the container, though the text does not demonstrate that the host machine was compromised.

What the attacker needed

Vulnerable Spring Cloud Function version; affected routing-expression endpoint exposed; network access to the service

The fix

Upgrade to Spring Cloud Function 3.1.7 or 3.2.3 and later, or disable the affected HTTP endpoint if upgrading cannot happen immediately.

How it was found

  1. Deploy the vulnerable Spring Cloud Function 3.2.2 application in a local Docker container and map its service to port 8080.
  2. Check whether the application is responding; a 404 at the root URL does not mean the service is offline.
  3. Open Metasploit and search for CVE-2022-22963 to find the testing module.
  4. Configure the module to target the locally hosted service.
  5. Run the test; although the automatic check did not reliably confirm exploitability, Metasploit reported a Meterpreter session.
  6. Use getuid and whoami to verify the session runs as root inside the container.

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 that lets developers write small functions that run in different environments. It read a special HTTP header and treated its contents as a formula (a SpEL expression) to decide which function to run. Because the formula language can call Java code, an attacker who controlled that header could make the server run commands.

What is RCE?

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

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.