
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vulnerable to remote code execution (RCE) via data binding. The specific exploit requires the application to run on Tomcat as a WAR deployment. If the application is deployed as a Spring Boot executable jar, i.e. the default, it is not vulnerable to the exploit. However, the nature of the vulnerability is more general, and there may be other ways to exploit it.
CVE-2022-22965(Spring4Shell,SpringShell)是Spring框架中的一个漏洞,它利用数据绑定功能将HTTP请求中存储的数据绑定到应用程序使用的某些对象。该漏洞存在于getCachedIntrospectionResults方法中,攻击者可以通过HTTP请求传递类名来未经授权访问此类对象。当使用特殊对象类时,会导致数据泄露和远程代码执行的风险。此漏洞类似于早已关闭的CVE-2010-1622,该漏洞通过添加类名检查作为修复,以确保名称不匹配classLoader或protectionDomain。
根据CVSSv3系统,其评分为严重(CRITICAL)等级。
以下是可用于识别CVE-2022-22965漏洞的检测方法。
当前漏洞的条件(如Spring公告中所陈述)可总结如下:
python3 exploit.py http://10.10.10.10/
注意: 末尾的斜杠在这里非常重要!
查找联系表单的"action"(我们唯一可用的POST请求)。
<form id="contactForm" action="/" method="post">
action是"/",这意味着我们的目标URL将是:http://10.10.10.10/