网站推广策划案,网站需求设计文档,基层网站建设存在困难,建信网证书查询平台spring Framework 特定条件下目录遍历漏洞#xff08;CVE-2024-38816#xff09;修复 漏洞描述
CVE-2024-38816: Path traversal vulnerability in functional web frameworks
通过功能性 Web 框架 WebMvc.fn 或 WebFlux.fn 提供静态资源的应用程序容易受到路径遍历攻击。攻…spring Framework 特定条件下目录遍历漏洞CVE-2024-38816修复 漏洞描述
CVE-2024-38816: Path traversal vulnerability in functional web frameworks
通过功能性 Web 框架 WebMvc.fn 或 WebFlux.fn 提供静态资源的应用程序容易受到路径遍历攻击。攻击者可以编写恶意 HTTP 请求并获取文件系统上任何可由 Spring 应用程序正在运行的进程访问的文件。
具体来说当以下两个条件都成立时应用程序就容易受到攻击
Web 应用程序用于RouterFunctions提供静态资源资源处理明确配置了FileSystemResource位置
但是当以下任何一项满足时恶意请求都会被阻止和拒绝
Spring Security HTTP 防火墙正在使用中应用程序在 Tomcat 或 Jetty 上运行
受影响的 Spring 产品和版本
Spring 框架
5.3.0 - 5.3.396.0.0 - 6.0.236.1.0 - 6.1.12较旧的、不受支持的版本也受到影响 分析
通常我们会把sprintboot项目打包war部署tomcat
或者直接本地springboot 运行(内置tomcat)
上述两种方式都阻止漏洞因为tomcat会拦截返回错误如下
!doctype html
html langenheadtitleHTTP Status 400 – Bad Request/titlestyle typetext/cssbody {font-family: Tahoma, Arial, sans-serif;}h1,h2,h3,b {color: white;background-color: #525D76;}h1 {font-size: 22px;}h2 {font-size: 16px;}h3 {font-size: 14px;}p {font-size: 12px;}a {color: black;}.line {height: 1px;background-color: #525D76;border: none;}/style
/headbodyh1HTTP Status 400 – Bad Request/h1hr classline /pbType/b Status Report/ppbMessage/b Invalid URI/ppbDescription/b The server cannot or will not process the request due to something that is perceived to be aclient error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)./phr classline /h3Apache Tomcat/9.0.46/h3
/body/html
综上内置和外置的tomcat都会校验地址通过后才会进入spring webmvc解析才可能触发漏洞。
因此要重现漏洞需用不知名web服务器。 webflux默认采用netty也无需处理。
漏洞原因spring地址解析URL地址代码考虑欠缺需要依赖前置的web服务器(比如tomcat)拦截 修复参考
https://xz.aliyun.com/t/15779?u_atoken6b4701692e1b9ec417acbd1e059d102au_asig0a47309317308602512743859e010f