springboot指定版本web等中间件
原创2024年5月1日小于 1 分钟
背景介绍
前置依赖说明,
springboot用的版本是2.x.x版本 ,JDK用的是1.8版本
某一天
springboot应用被扫描出现以下漏洞
Spring Web UriComponentsBuilder URL解析不当漏洞(CVE-2024-22243)解决方案是
命中:["spring-web(jar) version less than 5.3.32"]
解决方案
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.7.9</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>5.3.33</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>5.3.33</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</dependencyManagement>