【高危】- Spring Cloud Gateway 远程代码执行漏洞风险通告(CVE-2022-22947)
■ 漏洞描述
Spring Cloud Gateway 是基于 Spring Framework 和 Spring Boot 构建的 API 网关,它旨在为微服务架构提供一种简单、有效、统一的 API 路由管理方式。
据公告描述,当启用和暴露 Gateway Actuator 端点时,使用 Spring Cloud Gateway 的应用程序可受到代码注入攻击。攻击者可以发送特制的恶意请求,从而远程执行任意代码。
 
■ 影响范围
Spring Cloud Gateway < 3.1.1
Spring Cloud Gateway < 3.0.7
Spring Cloud Gateway 其他已不再更新的版本
 
■ 漏洞检测
https://github.com/projectdiscovery/nuclei-templates/pull/3815/commits/9ba37cacfdb2327a50f8ba0cd6bd86fdf10c52a8
https://wya.pl/2022/02/26/cve-2022-22947-spel-casting-and-evil-beans/
 
■ 漏洞修复
官方已发布漏洞补丁及修复版本,请评估业务是否受影响后,酌情升级至安全版本
 
■ 临时修复
临时缓解措施:
1.如果不需要Gateway actuator endpoint,可通过 management.endpoint.gateway.enabled: false 禁用它。
2.如果需要actuator,则应使用 Spring Security 对其进行防护,可参考:https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints.security。
 
■ 漏洞详情
据公告描述,当启用和暴露 Gateway Actuator 端点时,使用 Spring Cloud Gateway 的应用程序可受到代码注入攻击。攻击者可以发送特制的恶意请求,从而远程执行任意代码。