升级原因:
Logback是一个 Java 应用程序的日志记录框架。
Logback存在远程代码执行漏洞,有编辑配置文件所需权限的攻击者可以制作恶意配置,允许执行从 LDAP 服务器加载的任意代码。
解决办法:
排除springboot自带的logback-classic:1.2.3(如果不排除会报错)
方法一:找到springboot项目中所有如下代码
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-xxx</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>
修改为:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-xxx</artifactId>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
<version>2.0.3.RELEASE</version>
</dependency>
方法二:直接修改
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
<version>2.0.3.RELEASE</version>
</parent>
添加要升级的版本
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.11</version>
</dependency>