CYREBRO

resource

Spring Patched 'Spring4Shell' 0-Day RCE Vulnerability

April 3, 2022

Spring Patched 'Spring4Shell' 0-Day RCE Vulnerability

In an official advisory, Spring has addressed the 'Spring4Shell' remote code execution 0-day vulnerability, clarifying which 'Spring Framework' configurations are vulnerable, how to detect impact, and assigning a proper CVE to the vulnerability.

The Vulnerability

If the application is deployed as a Spring Boot executable jar ( i.e. the default), it is not vulnerable to the exploit. However, the nature of the vulnerability is more general, and there may be other ways to exploit it.

Vulnerable Products

'Spring Framework' versions:

Mitigation

For full mitigation, CYREBRO recommends updating to 'Spring Framework' 5.3.18 and 5.2.20 or greater.

Workaround

If the mitigation steps cannot be applied for any reason, implement one of the linked temporary workarounds below:

References: Spring Advisory.

 

Spring: 2 RCE Vulnerabilities, 1 Zero-Day

Multiple sources have reported of 2 remote code execution vulnerabilities. One RCE affects 'Spring Cloud Function', and the second RCE is a critical zero-day vulnerability dubbed 'Spring4Shell', affecting 'Spring Core' with JDK version 9.0 or newer, running specific configurations. Currently, the 'Spring4Shell' vulnerability has only a workaround available. Spring is a subsidiary of VMware. It offers development services through several platforms. 'Spring Framework' is an application framework and inversion of control container for the Java platform. 'Spring Cloud' is a cloud application development platform.

The Vulnerabilities

Affected Products

Products affected by CVE-2022-22963:

Products affected by Spring4Shell:

Mitigation

CVE-2022-22963 CYREBRO urges all clients to upgrade 'Spring Cloud Function' to versions 3.1.7 or 3.2.3 to fully mitigate the vulnerability.

Workaround

for 'Spring4Shell' As a temporary workaround of the vulnerability, CYREBRO recommends creating a 'ControllerAdvice' component (a Spring component shared across Controllers) and adding the following patterns to the denylist:
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.InitBinder;
@ControllerAdvice
@Order(10000)
public class BinderControllerAdvice {
    @InitBinder
    public void setAllowedFields(WebDataBinder dataBinder) {
         String[] denylist = new String[]{"class.*", "Class.*", "*.class.*", "*.Class.*"};
         dataBinder.setDisallowedFields(denylist);
    }
}
CYREBRO continues monitoring the vulnerability and will update customers with any relevant developments.

References: VMware advisory, Bleeping Computer