突發(fā)!Spring Cloud 爆高危漏洞。。趕緊修復(fù)??!
Spring Cloud 突發(fā)漏洞
Log4j2 的核彈級漏洞剛告一段落,Spring Cloud Gateway 又突發(fā)高危漏洞,又得折騰了。。。
2022年3月1日,Spring官方發(fā)布了關(guān)于Spring Cloud Gateway的兩個CVE漏洞,分別為CVE-2022-22946與CVE-2022-22947:
版本/分支/tag:?3.4.X
問題描述

Spring Cloud Gateway 是 Spring Cloud 下的一個項目,該項目是基于 Spring 5.0、Spring Boot 2.0 和 Project Reactor 等技術(shù)開發(fā)的網(wǎng)關(guān),它旨在為微服務(wù)架構(gòu)提供一種簡單有效、統(tǒng)一的 API 路由管理方式。
漏洞1:Spring Cloud Gateway?遠(yuǎn)程代碼執(zhí)行漏洞(CVE-2022-22947)
漏洞描述
使用 Spring Cloud Gateway 的應(yīng)用如果對外暴露了 Gateway Actuator 端點時,則可能存在被 CVE-2022-22947 漏洞利用的風(fēng)險。攻擊者可通過利用此漏洞執(zhí)行 SpEL 表達式,允許在遠(yuǎn)程主機上進行任意遠(yuǎn)程執(zhí)行。,獲取系統(tǒng)權(quán)限。
影響范圍
漏洞利用的前置條件:
除了 Spring Cloud Gateway 外,程序還用到了 Spring Boot Actuator 組件(它用于對外提供 /actuator/ 接口);
Spring 配置對外暴露 gateway 接口,如 application.properties 配置為:
# 默認(rèn)為truemanagement.endpoint.gateway.enabled=true# 以逗號分隔的一系列值,默認(rèn)為 health# 若包含 gateway 即表示對外提供 Spring Cloud Gateway 接口management.endpoints.web.exposure.include=gateway
Spring Cloud Gateway 3.1.x < 3.1.1 Spring Cloud Gateway 3.0.x < 3.0.7 其他舊的、不受支持的 Spring Cloud Gateway 版本
解決方案
更新升級 Spring Cloud Gateway 到以下安全版本:
Spring Cloud Gateway 3.1.1
Spring Cloud Gateway 3.0.7
或者在不考慮影響業(yè)務(wù)的情況下禁用 Gateway actuator 接口:
在application.properties 中設(shè)置?:
management.endpoint.gateway.enabled 為 false。漏洞2:CVE-2022-22946:Spring Cloud Gateway HTTP2 不安全的 TrustManager
漏洞描述
影響范圍
解決方案
參考資料
官方已經(jīng)發(fā)布安全版本,請升級到3.1.1+
https://tanzu.vmware.com/security/cve-2022-22946 https://tanzu.vmware.com/security/cve-2022-22947
如果本文對你有幫助的話,請不要吝嗇你的贊,謝謝!

