spring boot使用spring-boot-starter-thymeleaf报Provides transitive vulnerable dependency org.yaml:snakeyaml:1.33
时间: 2023-05-29 20:07:15 浏览: 969
这是因为Spring Boot使用了Thymeleaf模板引擎,而Thymeleaf依赖于SnakeYAML库。而SnakeYAML 1.33版本存在安全漏洞,因此造成了提供的传递性漏洞依赖。
为了解决这个问题,可以尝试升级SnakeYAML库到最新版本,或者使用一个不受影响的版本。可以在Maven或Gradle构建文件中指定一个特定版本的SnakeYAML库,例如:
```
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.27</version>
</dependency>
```
或者
```
implementation('org.yaml:snakeyaml:1.27')
```
注意,这可能会导致其他依赖项出现问题,因此最好在升级或更改依赖项之前进行全面测试。
阅读全文
相关推荐
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)