最近阿里雲團隊發現log4j漏洞,危險級別:嚴重,相關資訊
https://m.sohu.com/coo/hsdt/506958086_355140
https://www.sohu.com/a/506958086_355140
具體解決辦法,參考下面
方式一
1.點擊idea maven對應引用視圖按鈕
2.找到log4j相應的依賴
3.點擊從root到你選擇的路徑
3.在你項目中找到相關依賴,排除掉
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> <exclusions> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-to-slf4j</artifactId> </exclusion> </exclusions> </dependency>
多模塊版本pagehelper-spring-boot-starter
、spring-boot-starter-web
依賴分別排除一下。
方式二 升級log4j
依賴
在pom.xml
新增log4j
的版本為2.15.0-rc2
覆蓋低版本,這個需要自己去下載最新的 log4j-2.15.0-rc2
版本,地址 https://github.com/apache/logging-log4j2/releases/tag/log4j-2.15.0-rc2 同時intsall到maven倉庫去,因為這個還沒有發布maven中央倉庫。
<dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-to-slf4j</artifactId> <version>2.15.0-rc2</version> </dependency>