GHSA-36p3-wjmg-h94x
Remote Code Execution in Spring Framework
En bref
- Publiée
- Mise à jour
- CVE
- CVE-2022-22965
- CVSS_V3
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H
Description
Spring Framework prior to versions 5.2.20 and 5.3.18 contains a remote code execution vulnerability known as `Spring4Shell`. ## Impact A Spring MVC or Spring WebFlux application running on JDK 9+ may be vulnerable to remote code execution (RCE) via data binding. The specific exploit requires the application to run on Tomcat as a WAR deployment. 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. These are the prerequisites for the exploit: - JDK 9 or higher - Apache Tomcat as the Servlet container - Packaged as WAR - `spring-webmvc` or `spring-webflux` dependency ## Patches - Spring Framework [5.3.18](https://github.com/spring-projects/spring-framework/releases/tag/v5.3.18) and [5.2.20](https://github.com/spring-projects/spring-framework/releases/tag/v5.2.20.RELEASE) - Spring Boot [2.6.6](https://github.com/spring-projects/spring-boot/releases/tag/v2.6.6) and [2.5.12](https://github.com/spring-projects/spring-boot/releases/tag/v2.5.12) ## Workarounds For those who are unable to upgrade, leaked reports recommend setting `disallowedFields` on `WebDataBinder` through an `@ControllerAdvice`. This works generally, but as a centrally applied workaround fix, may leave some loopholes, in particular if a controller sets `disallowedFields` locally through its own `@InitBinder` method, which overrides the global setting. To apply the workaround in a more fail-safe way, applications could extend `RequestMappingHandlerAdapter` to update the `WebDataBinder` at the end after all other initialization. In order to do that, a Spring Boot application can declare a `WebMvcRegistrations` bean (Spring MVC) or a `WebFluxRegistrations` bean (Spring WebFlux).
Paquets affectés
| Paquet | Versions |
|---|---|
| Maven · org.springframework:spring-beans | introduced 0, fixed 5.2.20.RELEASE |
| Maven · org.springframework:spring-beans | introduced 5.3.0, fixed 5.3.18 |
| Maven · org.springframework:spring-webmvc | introduced 0, fixed 5.2.20.RELEASE |
| Maven · org.springframework:spring-webmvc | introduced 5.3.0, fixed 5.3.18 |
| Maven · org.springframework.boot:spring-boot-starter-web | introduced 0, fixed 2.5.12 |
| Maven · org.springframework.boot:spring-boot-starter-web | introduced 2.6.0, fixed 2.6.6 |
| Maven · org.springframework:spring-webflux | introduced 0, fixed 5.2.20.RELEASE |
| Maven · org.springframework:spring-webflux | introduced 5.3.0, fixed 5.3.18 |
| Maven · org.springframework.boot:spring-boot-starter-webflux | introduced 0, fixed 2.5.12 |
| Maven · org.springframework.boot:spring-boot-starter-webflux | introduced 2.6.0, fixed 2.6.6 |
Références
- https://nvd.nist.gov/vuln/detail/CVE-2022-22965 ADVISORY
- https://github.com/spring-projects/spring-framework/commit/002546b3e4b8d791ea6acccb81eb3168f51abb15 WEB
- https://cert-portal.siemens.com/productcert/pdf/ssa-254054.pdf WEB
- https://github.com/spring-projects/spring-boot/releases/tag/v2.5.12 WEB
- https://github.com/spring-projects/spring-boot/releases/tag/v2.6.6 WEB
- https://github.com/spring-projects/spring-framework PACKAGE
- https://github.com/spring-projects/spring-framework/releases/tag/v5.2.20.RELEASE WEB
- https://github.com/spring-projects/spring-framework/releases/tag/v5.3.18 WEB
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0005 WEB
- https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement WEB
- https://tanzu.vmware.com/security/cve-2022-22965 WEB
- https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-java-spring-rce-Zx9GUc67 WEB
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2022-22965 WEB
- https://www.kb.cert.org/vuls/id/970766 WEB
- https://www.oracle.com/security-alerts/cpuapr2022.html WEB
- https://www.oracle.com/security-alerts/cpujul2022.html WEB
- http://packetstormsecurity.com/files/166713/Spring4Shell-Code-Execution.html WEB
- http://packetstormsecurity.com/files/167011/Spring4Shell-Spring-Framework-Class-Property-Remote-Code-Execution.html WEB
Sources
| Source | Licence |
|---|---|
| OSV.dev | CC-BY 4.0 — GitHub Advisory Database |