How Tanium Can Help with the Spring Cloud RCE Vulnerability - CVE-2022-22963

Overview

In late March, two remote code execute (RCE) vulnerabilities were announced, affecting two Spring tools. Similar product names and CVE identifications caused some confusion.  CVE-2022-22965 affects the Spring Framework (see the Community article here), and CVE-2022-22963 affects Spring Cloud Function.

Originally released on March 24, 2022 as a server-side code injection vulnerability, CVE-2022-22963 was upgraded to a remote code execution vulnerability on March 31, 2022. 

Background – Spring

Spring is a platform on which developers can create Java applications.  This widely used tooling is popular due to its ease and speed of implementation.  The framework can support web applications, serverless functions, automation, and cloud.  Spring Cloud, while not a provider of April Showers, is tailored to the unique needs of cloud-native application development.

CVE-2022-22963 – How it Works

Spring can utilize the Spring Expression Language (SpEL).  In Spring Cloud Function, the vulnerable versions allowed injection of the code via an HTTP header, allowing an attacker to leverage this powerful capability to execute code on the endpoint.  An attacker would include a header key, spring.cloud.function.routing-expression, in their HTTP POST request with the value containing their malicious Java code. 

While no mitigations or workarounds have been provided, Spring has recommended 3.1.7 or 3.2.3 as fixed versions.  Tanium will continue to monitor and update this article as information becomes available.

Finding the Vulnerability

Tanium can help you find systems that meet the criteria that determine potential vulnerability in seconds, at scale, without the need to run high-impact scans or visit individual systems directly.

Tanium Interact

Leveraging Tanium Interact with Index (an entitlement included with Tanium Reveal and Tanium Threat Response), the following question can help to identify endpoints with the Spring Cloud function on disk: 

Get Reveal - Index File Details [10,*,*spring-cloud*,*,*,*,*,*,*,0,0,,] from all machines

Note:

Depending on what module granted index entitlement, there may be a need to change the sensor used from Reveal – Index File Details to Index – File Details to return results.

Tanium Reveal

Tanium Reveal can identify endpoints warranting further investigation by using specific Rules or the Quick Search functionality. You can use Reveal Quick Search to quickly identify indicators, or you may set up Reveal Rules using your custom pattern definitions.  

Quick Search

  1. From Tanium Reveal, select Quick Search.

  2.  In the text-entry box, enter spring-cloud-function and click the Search button

  3. As results populate, you can perform further investigation by selecting the computer name and directly connecting to the endpoint to evaluate the files where spring-cloud-function was found.

  4. To save the Quick Search for future on-demand use, click the plus sign next to the tokenized quick search you just performed and rename it to Spring Cloud Function.

  5. Navigate to the Reveal Quick Search page and issue future searches by clicking the magnifying glass next to the saved search. Clicking on this saved search launches the workflow as seen in the Quick Search steps above.

 
CVE202222963HelpSpri_6591651b-1879-47bf-a819-a233aa339f5e.png

Reveal Pattern Editing and Keyword Lists with Rules

The new Pattern Editing feature in Tanium Reveal allows for an easier workflow to create and manage patterns to leverage within custom Reveal Rules. 

Reveal Keyword Lists

  1. Navigate to the Reveal Home Page > Patterns.

  2. To create the two keyword list patterns, click the Create Pattern > Keyword Pattern.


    User-added image
  3. Define patterns either manually, or using an uploaded CSV.

    1. To manually define a pattern, enter the first keyword pattern and click Create. In this example, spring-cloud-function is used. 

       
      CVE202222963HelpSpri_8f673151-4576-4b93-a9f7-bc85aa7c08f2.png
    2. To upload a CSV of defined patterns

      1. Create a keyword list that contains the release versions of interest. These can be imported from a CSV file. On the Patterns page, click Create Pattern and click Keyword Again. Below, the name is identified as Spring Cloud Versions. The example file contains several version numbers based on the criteria of concern.

      2. Scroll down and click the Browse button and browse for the desired file. There is an opportunity for validation of the imported file, prior to saving the pattern as noted below: 

         
        CVE202222963HelpSpri_5b34b3c0-9619-4b3d-af2a-7f238ecc1bdc.png
      3. Click Create

  4. Navigate back to the Tanium Reveal Home Page and click Rule Sets > New Rule Set.

     
    CVE202222963HelpSpri_0f6848df-48f3-4a51-b423-ae7a9ed1341c.png
     
  5. Click Target Computer Groups.  Choose what endpoint criteria is within scope and click the Assign button.

  6. Click Save.

Create Rules in Tanium Reveal

This section walks through the rule creation to look for the two custom patterns within 25 characters of each other, as well as searching in zip files (which includes ear, war, and jar).

  1. Navigate back to the Tanium Reveal Home Page and click Rules > Create Rule.

  2. Name the rule Spring Cloud Function Versions.

  3. Click Add Rule Sets and select the Spring Framework Rule Set, then click Assign.

     
    CVE202222963HelpSpri_6ccef346-2a61-4a97-a66e-64c17d7e627c.png
  4. Click Add Filter, select File Type, and then choose Zip.

  5. Next, create a Pattern Group. Click Add Pattern Group > Set Proximity to 25 characters > Click Add Pattern.

     
    CVE202222963HelpSpri_eb3578c2-7dfb-4a92-8bfd-21db74961055.png
  6. Click Save.

Deploy Reveal Rules

From the Reveal > Rules page, click the Deploy All Rulesets button to deploy the rules.

 
CVE202222963HelpSpri_a5d42bbd-c2c8-4e9e-a7fa-dba76103bfeb.png

The endpoints will receive the new rule set and begin scanning the reveal database searching for matches of the new Pattern Group.

Remediation

Upgrading to the Spring Cloud Function version 3.1.7 or 3.2.3 is currently the only identified remediation option.No workarounds have been identified.

References