我是靠谱客的博主 缥缈花卷,这篇文章主要介绍SpringBoot更换Apache Log4 2.15.0-rc2j漏洞补丁1.Apache Log4j 远程代码执行漏洞以及修复建议2.编译最新的源码成jar包3.在springboot项目中更新log4j补丁,现在分享给大家,希望可以做个参考。
文章目录
- 1.Apache Log4j 远程代码执行漏洞以及修复建议
- 2.编译最新的源码成jar包
- 3.在springboot项目中更新log4j补丁
- 3.1把编译好的jar包放到项目根路径下
- 3.2 引入依赖
- 3.3 配置把本地jar打包到项目中
1.Apache Log4j 远程代码执行漏洞以及修复建议
Apache Log4j2是一款优秀的Java日志框架。2021年11月24日,阿里云安全团队向Apache官方报告了Apache Log4j2远程代码执行漏洞。由于Apache Log4j2某些功能存在递归解析功能,攻击者可直接构造恶意请求,触发远程代码执行漏洞。漏洞利用无需特殊配置,经阿里云安全团队验证,Apache Struts2、Apache Solr、Apache Druid、Apache Flink等均受影响。阿里云应急响应中心提醒 Apache Log4j2 用户尽快采取安全措施阻止漏洞攻击。
具体参考: https://view.inews.qq.com/a/20211210A01JXN00
2.编译最新的源码成jar包
由于maven中央仓库没有漏洞补丁版本,所以需要下载源码编译

重github上面下载源码编译成jar包
log4j-2.15.0-rc2补丁源码
也可以用我已经编译好的
网盘链接:https://pan.baidu.com/s/1JMeC1MF6me0l78woA1k6Zw
提取码:j6lx

3.在springboot项目中更新log4j补丁
3.1把编译好的jar包放到项目根路径下
可以把jar包上传到maven私服

3.2 引入依赖
- 可以把jar包上传到maven私服或者本地化引用
- 排除springboot框架默认的log4j包然后引入漏洞补丁
<!--排查默认的apache.logging日志包-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.15.0.rc2</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/log4j-core-2.15.0.rc2.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.15.0.rc2</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/log4j-api-2.15.0.rc2.jar</systemPath>
</dependency>
3.3 配置把本地jar打包到项目中
需要是把补丁上传到maven私服则不需要配置
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>
最后
以上就是缥缈花卷最近收集整理的关于SpringBoot更换Apache Log4 2.15.0-rc2j漏洞补丁1.Apache Log4j 远程代码执行漏洞以及修复建议2.编译最新的源码成jar包3.在springboot项目中更新log4j补丁的全部内容,更多相关SpringBoot更换Apache内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复