[编程代码] Apache Log4j任意代码执行漏洞修复 spring-boot-starter-log4j2

5355 0
黑夜隐士 2021-12-13 08:10:57 | 显示全部楼层 |阅读模式

spring-boot-starter-log4j2修复方式

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-log4j2</artifactId>
  4. </dependency>
复制代码

替换为:

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-log4j2</artifactId>
  4. <exclusions>
  5. <exclusion>
  6. <groupId>org.apache.logging.log4j</groupId>
  7. <artifactId>log4j-api</artifactId>
  8. </exclusion>
  9. <exclusion>
  10. <groupId>org.apache.logging.log4j</groupId>
  11. <artifactId>log4j-core</artifactId>
  12. </exclusion>
  13. </exclusions>
  14. </dependency>
  15. <dependency>
  16. <groupId>org.apache.logging.log4j</groupId>
  17. <artifactId>log4j-api</artifactId>
  18. <version>2.15.0</version>
  19. </dependency>
  20. <dependency>
  21. <groupId>org.apache.logging.log4j</groupId>
  22. <artifactId>log4j-core</artifactId>
  23. <version>2.15.0</version>
  24. </dependency>
复制代码

maven中央仓库目前还没有,可以通过下载源码本地进行构建

源码地址:Release log4j-2.15.0-rc2 · apache/logging-log4j2

2021年11月24日,阿里云安全团队向Apache官方报告了Apache Log4j2远程代码执行漏洞。2021年12月10日,阿里云安全团队发现 Apache Log4j 2.15.0-rc1 版本存在漏洞绕过,请及时更新至 Apache Log4j 2.15.0-rc2 版本。

漏洞描述

Apache Log4j2是一款优秀的Java日志框架。2021年11月24日,阿里云安全团队向Apache官方报告了Apache Log4j2远程代码执行漏洞。由于Apache Log4j2某些功能存在递归解析功能,攻击者可直接构造恶意请求,触发远程代码执行漏洞。漏洞利用无需特殊配置,经阿里云安全团队验证,Apache Struts2、Apache Solr、Apache Druid、Apache Flink等均受影响。2021年12月10日,阿里云安全团队发现 Apache Log4j 2.15.0-rc1 版本存在漏洞绕过,请及时更新至 Apache Log4j 2.15.0-rc2 版本。阿里云应急响应中心提醒 Apache Log4j2 用户尽快采取安全措施阻止漏洞攻击。

漏洞评级

Apache Log4j 远程代码执行漏洞 严重

影响版本

经验证 2.15.0-rc1 版本存在绕过,实际受影响范围如下:

Apache Log4j 2.x < 2.15.0-rc2

安全建议

1、排查应用是否引入了Apache log4j-core Jar包,若存在依赖引入,且在受影响版本范围内,则可能存在漏洞影响。请尽快升级Apache Log4j2所有相关应用到最新的 log4j-2.15.0-rc2 版本,地址https://github.com/apache/logging-log4j2/releases/tag/log4j-2.15.0-rc2

2、升级已知受影响的应用及组件,如 spring-boot-starter-log4j2/Apache Struts2/Apache Solr/Apache Druid/Apache Flink

3、可升级jdk版本至6u211 / 7u201 / 8u191 / 11.0.1以上,可以在一定程度上限制JNDI等漏洞利用方式。

相关链接

1、https://github.com/apache/logging-log4j2


来源:https://blog.csdn.net/wzj_vip/article/details/121857170
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行