GHSA-36P3-WJMG-H94X
Remote Code Execution in Spring Framework
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-36P3-WJMG-H94X divulgada | |
| Remediación | Parche 5.2.20.RELEASE | org.springframework:spring-beans · 0 d desde divulgación | |
| Remediación | Parche 5.3.18 | org.springframework:spring-beans · 0 d desde divulgación | |
| Remediación | Parche 2.5.12 | org.springframework.boot:spring-boot-starter-web · 0 d desde divulgación | |
| Remediación | Parche 2.6.6 | org.springframework.boot:spring-boot-starter-web · 0 d desde divulgación | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice |
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.18and 5.2.20https://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.6and 2.5.12https://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).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
mavenorg.springframework:spring-beans |
Corregida | 5.2.20.RELEASE, 5.3.18 | 0 d · 0 d | 7.1.0 no afectada |
mavenorg.springframework:spring-webmvc |
Corregida | 5.2.20.RELEASE, 5.3.18 | 0 d · 0 d | 7.1.0 no afectada |
mavenorg.springframework.boot:spring-boot-starter-web |
Corregida | 2.5.12, 2.6.6 | 0 d · 0 d | 4.2.0 no afectada |
mavenorg.springframework:spring-webflux |
Corregida | 5.2.20.RELEASE, 5.3.18 | 0 d · 0 d | 7.1.0 no afectada |
mavenorg.springframework.boot:spring-boot-starter-webflux |
Corregida | 2.5.12, 2.6.6 | 0 d · 0 d | 4.2.0 no afectada |
2.5.122.6.65.2.20.RELEASE5.3.18Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://nvd.nist.gov/vuln/detail/CVE-2022-22965https://github.com/spring-projects/spring-framework/commit/002546b3e4b8d791ea6acccb81eb3168f51abb15https://cert-portal.siemens.com/productcert/pdf/ssa-254054.pdfhttps://github.com/spring-projects/spring-boot/releases/tag/v2.5.12https://github.com/spring-projects/spring-boot/releases/tag/v2.6.6https://github.com/spring-projects/spring-frameworkhttps://github.com/spring-projects/spring-framework/releases/tag/v5.2.20.RELEASEhttps://github.com/spring-projects/spring-framework/releases/tag/v5.3.18https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0005https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcementhttps://tanzu.vmware.com/security/cve-2022-22965https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-java-spring-rce-Zx9GUc67Ver 6 referencias más
https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2022-22965https://www.kb.cert.org/vuls/id/970766https://www.oracle.com/security-alerts/cpuapr2022.htmlhttps://www.oracle.com/security-alerts/cpujul2022.htmlhttp://packetstormsecurity.com/files/166713/Spring4Shell-Code-Execution.htmlhttp://packetstormsecurity.com/files/167011/Spring4Shell-Spring-Framework-Class-Property-Remote-Code-Execution.htmlLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
