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
spring4shell-local-verification-lab — Spring Framework CVE-2022-22965 本地影响条件验证、版本升级修复与复测项目 | Kitploit
Tools/GitHubGitHub/meng-security/spring4shell-local-verification-lab
Vulnerability AnalysisCode AnalysisExploitationWeb SecurityLearning & EducationLabs & Practice
GitHubmeng-security/spring4shell-local-verification-lab

spring4shell-local-verification-lab

Spring Framework CVE-2022-22965 本地影响条件验证、版本升级修复与复测项目

View Repository
11 month 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

Spring4Shell Local Impact Condition Verification, Remediation, and Re-testing Project

Project Introduction

This project is used for learning and verifying the impact conditions, risk manifestations, remediation methods, and post-remediation re-testing procedures for Spring Framework CVE-2022-22965, also known as the Spring4Shell vulnerability.

The project was completed in a locally built authorized environment. The focus of the project is not on attacking real targets, but on building pre- and post-remediation Spring MVC test environments, verifying the vulnerability-related impact conditions item by item, and observing the differences in internal property path access in the Spring data binding before and after version upgrades in a safe, controlled read-only manner.

This project completed the following process:

  • JDK, Maven, and Apache Tomcat environment preparation
  • Spring MVC WAR project setup
  • Normal functionality baseline verification
  • Vulnerability impact condition confirmation
  • Read-only diagnosis of internal property paths
  • Vulnerability cause analysis
  • Spring Framework version upgrade
  • Post-remediation security re-testing
  • Post-remediation normal functionality re-testing
  • Test report and screenshot evidence organization

Security Statement

This project is only intended for personal local self-built environments or explicitly authorized security testing environments.

The project does not scan, probe, or exploit any public websites, servers, or third-party business systems, and does not contain real user data or real business data.

The following operations were NOT performed during testing:

  • No WebShell was written
  • No system commands were executed
  • No Tomcat configuration was modified
  • No reverse shell was established
  • No persistence control was implemented
  • No impact was made on any external systems

It is prohibited to use the test methods in this project on any unauthorized targets.

Vulnerability Background

CVE-2022-22965, commonly known as Spring4Shell, is a remote code execution vulnerability related to the request parameter data binding mechanism in Spring Framework.

Spring MVC supports automatically binding HTTP request parameters to Java object properties. For example, this project receives name and email parameters through the following method:

@ModelAttribute("profile") UserProfile profile

Under normal circumstances, the request parameters name and email are bound to the UserProfile object according to property names.

In the affected versions, access restrictions on some internal property paths are not strict enough. When using JDK 9 or higher, and when specific Servlet container, deployment method, and data binding conditions are met, external request parameters may access internal objects related to Java Class, modules, class loaders, or the container along the ordinary business object.

In a specific exploitable environment, an attacker may further modify server configurations or write server files, thereby creating a remote code execution risk.

This project does not perform full remote code exploitation; instead, it uses the following property path for safe, read-only differential diagnosis:

class.module.name

Project Objectives

  1. Understand the basic process of Spring MVC request parameter data binding.
  2. Set up a local Spring MVC WAR test project.
  3. Complete baseline verification of normal business functionality.
  4. Confirm impact conditions such as Spring Framework, JDK, Tomcat, WAR deployment, and data binding entry points.
  5. Observe access behavior of internal property paths in a read-only manner.
  6. Analyze the main causes of the vulnerability.
  7. Upgrade Spring Framework to a fixed version.
  8. Perform post-remediation re-testing using the same method.
  9. Confirm that the version upgrade did not affect normal business functionality.
  10. Organize project source code, test reports, and screenshot evidence.

Experimental Environment

This project was completed in a personal local VMware isolated experimental environment.

  • Host machine: Windows 11
  • Target machine: Windows 10 virtual machine
  • Virtualization software: VMware Workstation
  • Java environment: Eclipse Temurin JDK 11.0.31
  • Project build tool: Apache Maven 3.9.16
  • Servlet container: Apache Tomcat 9.0.60
  • Pre-fix Spring Framework version: 5.3.17
  • Post-fix Spring Framework version: 5.3.18
  • Web framework: Spring MVC
  • Project deployment method: Traditional WAR package deployment
  • Test address: 127.0.0.1

Normal functionality test data:

  • Name: Alice
  • Email: [email protected]

Security diagnostic property path:

class.module.name

Project Structure

spring4shell-local-verification-lab/

  • README.md: Project introduction, test methodology, verification results, and remediation explanation
  • docs/: Spring4Shell local impact condition verification, remediation, and re-testing report
  • images/: Screenshots of the project environment, testing process, and re-testing
  • vulnerable-demo/: Pre-remediation project using Spring Framework 5.3.17
  • fixed-demo/: Post-remediation project using Spring Framework 5.3.18
  • notes/: Study notes and process records

Main source code structure:

  • config/: Spring MVC configuration classes and application initializer classes
  • controller/: Form processing and property path diagnostic controller
  • model/: UserProfile class for receiving name and email parameters
  • WEB-INF/views/: JSP pages for homepage, submission result, and diagnostic result

Test Project Description

This project sets up two Spring MVC applications: one pre-remediation and one post-remediation.

Pre-remediation Project

Project directory:

vulnerable-demo

Version used:

Spring Framework 5.3.17

Generated WAR file:

spring4shell-vulnerable-demo.war

Access address:

http://127.0.0.1:8080/spring4shell-vulnerable-demo/

Diagnostic page:

http://127.0.0.1:8080/spring4shell-vulnerable-demo/binding-probe

Post-remediation Project

Project directory:

fixed-demo

Version used:

Spring Framework 5.3.18

Generated WAR file:

spring4shell-fixed-demo.war

Access address:

http://127.0.0.1:8080/spring4shell-fixed-demo/

Diagnostic page:

http://127.0.0.1:8080/spring4shell-fixed-demo/binding-probe

Normal Functionality Description

The test project provides a simple user profile form, including:

  • Name input field
  • Email input field
  • Submit profile button

The controller receives request parameters through the following method:

@ModelAttribute("profile") UserProfile profile

After the user submits the name and email, Spring MVC automatically binds the name and email parameters to the UserProfile object.

The result page reads the bound object and displays the user's submitted name and email.

This functionality is used to confirm that the project runs normally, and to prove that a valid Spring MVC request parameter data binding entry exists in the application.

Test Methodology

This project follows the approach: "first confirm normal functionality, then confirm impact conditions, then perform read-only risk diagnosis, and finally fix and re-test."

  1. Install and configure JDK 11, Maven, and Apache Tomcat.
  2. Set up a Spring MVC project using Spring Framework 5.3.17.
  3. Create a name and email form.
  4. Use @ModelAttribute to bind request parameters to the UserProfile object.
  5. Package the project as a WAR file using Maven.
  6. Deploy the WAR file to a standalone Apache Tomcat.
  7. Submit locally simulated user profile data to complete baseline verification of normal functionality.
  8. Check the actual running JDK, Tomcat, Spring Framework, and deployment method.
  9. Perform read-only diagnosis of class.module.name using Spring BeanWrapper.
  10. Record the property path access results in the Spring Framework 5.3.17 environment.
  11. Upgrade Spring Framework to 5.3.18.
  12. Rebuild and deploy the fixed project.
  13. Perform post-remediation re-testing using the same property path.
  14. Submit name and email again to confirm that normal functionality was not affected.

Impact Condition Confirmation

This project confirmed the following impact conditions one by one:

  • Uses JDK 11.0.31, meeting the JDK 9 or higher condition
  • Uses Spring Framework 5.3.17
  • Project includes the spring-webmvc component
  • Uses Apache Tomcat 9.0.60
  • Project deployed as a traditional WAR package
  • Project loaded by a standalone Tomcat
  • Controller has a data binding entry based on @ModelAttribute

The actual Spring dependencies deployed in the pre-remediation project include:

  • spring-beans-5.3.17.jar
  • spring-core-5.3.17.jar
  • spring-web-5.3.17.jar
  • spring-webmvc-5.3.17.jar

This project does not directly judge vulnerability existence solely based on the Spring Framework version, but conducts a comprehensive analysis combining JDK, Spring MVC, Tomcat, WAR deployment, and data binding entry.

Risk Diagnosis Method

To avoid executing destructive exploitation, this project uses the BeanWrapper provided by Spring Framework to perform a read-only check on the following property path:

class.module.name

This path means:

  • class: Accesses the Java Class object corresponding to the current business object
  • module: Accesses the Java module to which this class belongs
  • name: Reads the module name

The diagnosis process only calls property readability checks and property value reading methods:

  • Does not set object properties
  • Does not modify server configuration
  • Does not write server files
  • Does not execute operating system commands

Therefore, this diagnosis can only be used to observe the difference in access to internal property paths before and after remediation, and cannot alone prove that remote code execution has been achieved.

Verification Results

Pre-remediation Results

Pre-remediation environment uses:

Spring Framework 5.3.17

Property path checked:

class.module.name

Diagnosis result:

  • Is readable: true
  • Read result: null

true indicates that the current environment can continue to resolve module.name along the class property of an ordinary business object.

The read result is null because the current WAR application runs in the Java unnamed module, where the module name is empty; this does not mean the property path read failed.

Post-remediation Results

Post-remediation environment uses:

Spring Framework 5.3.18

Re-diagnose with the same property path:

class.module.name

Diagnosis result:

  • Is readable: false
  • Read result: Not readable

The results before and after remediation form a clear comparison:

  • Spring Framework 5.3.17: property path is readable
  • Spring Framework 5.3.18: property path is not readable

This result indicates that after the version upgrade, access to the original diagnostic property path has been restricted, and the risk manifestation observed before remediation no longer appears.

Remediation Measures

This project adopts the method of upgrading the Spring Framework version for remediation.

Pre-remediation configuration:

<spring.version>5.3.17</spring.version>

Post-remediation configuration:

<spring.version>5.3.18</spring.version>

The following operations were performed during the remediation process:

  1. Copy the pre-remediation project to fixed-demo.
  2. Keep the business logic of Controller, data model, and JSP pages unchanged.
  3. Upgrade Spring Framework from 5.3.17 to 5.3.18.
  4. Re-download the fixed version dependencies using Maven.
  5. Recompile and generate the fixed version WAR file.
  6. Deploy the fixed version WAR to Apache Tomcat.
  7. Check the actual deployed Spring JAR versions in the fixed project.
  8. Use the original property path to complete security re-testing.
  9. Re-test the name and email submission functionality.

The actual Spring dependencies deployed in the post-remediation project include:

  • spring-beans-5.3.18.jar
  • spring-core-5.3.18.jar
  • spring-web-5.3.18.jar
  • spring-webmvc-5.3.18.jar

This result proves that the fixed version was rebuilt and actually deployed, not just a change of the version number in pom.xml.

Post-remediation Normal Functionality Re-testing

After upgrading to Spring Framework 5.3.18, re-access the fixed project homepage and submit the following test data:

  • Name: Alice
  • Email: [email protected]

After submission, the page still displays normally:

  • User profile submitted successfully
  • Name is Alice
  • Email is [email protected]

This result indicates that the version upgrade did not affect the project's original normal request parameter binding and page display functionality.

Vulnerability Cause

Spring MVC's automatic data binding mechanism can access Java object properties based on HTTP request parameter names.

Normal business parameters name and email only need to access the corresponding ordinary properties in UserProfile.

However, Spring's property access mechanism also supports nested property paths with dots. In affected versions, the restrictions on some internal property paths are not strict enough, allowing external parameters to proceed from ordinary business objects to Java Class, modules, class loaders, or Servlet container-related objects under specific environments.

When there are writable properties in internal objects that can affect server configuration or the file system, and the application simultaneously meets conditions such as JDK, Tomcat, WAR deployment, and data binding, it may further lead to a remote code execution risk.

This vulnerability is not because the name or email properties themselves are problematic, nor is every project using Spring MVC necessarily exploitable. The existence of the vulnerability typically requires multiple conditions to be satisfied together.

Remediation Recommendations

For real business systems, the following measures are recommended:

  • Check the actual running versions of Spring Framework and Spring Boot
  • Prioritize upgrading to still-supported security versions
  • Rebuild and redeploy the application after upgrade
  • Check the actual Spring JAR versions in the final deployment package
  • Restrict the data binding scope of Controllers
  • Only allow binding of fields required for normal business
  • Use dedicated request data objects to receive external parameters
  • Avoid directly exposing database entities or internal complex objects to external parameters
  • Do not rely solely on front-end validation for security restrictions
  • For systems that cannot be upgraded immediately, apply temporary mitigation measures
  • Temporary mitigation measures cannot replace formal version upgrades
  • Run Tomcat and Java services with low-privilege accounts
  • Set minimum necessary permissions on application directories and configuration directories
  • Monitor abnormal request parameters and server file changes
  • Perform both security re-testing and normal business function re-testing after remediation

Key Screenshot Evidence

Environment and Deployment

JDK 11 version confirmation

Maven version confirmation

Apache Tomcat 9.0.60 startup success

Maven packaging success

WAR project deployment success

Normal Functionality Baseline

Test project homepage accessed normally

Normal functionality baseline verification success

Pre-remediation Verification

Spring Framework 5.3.17 dependency confirmation

Pre-remediation internal property path is readable

Remediation and Re-testing

Fixed version packaging success

Post-remediation internal property path is not readable

Post-remediation normal functionality re-testing success

Post-remediation Spring Framework 5.3.18 dependency confirmation

Current Progress

  • Create project directory
  • Write README
  • Create test report
  • Prepare JDK, Maven, and Tomcat environment
  • Set up Spring MVC test project
  • Complete WAR project packaging and deployment
  • Complete normal functionality baseline verification
  • Complete vulnerability impact condition confirmation
  • Complete local read-only risk diagnosis
  • Complete vulnerability cause analysis
  • Complete Spring Framework version upgrade
  • Complete post-remediation security re-testing
  • Complete post-remediation normal functionality re-testing
  • Confirm actual dependency versions after remediation
  • Organize test report and screenshot evidence

Project Summary

This project completed the impact condition confirmation, risk manifestation diagnosis, version upgrade remediation, and post-remediation re-testing for Spring Framework CVE-2022-22965 in a local isolated environment.

The pre-remediation project used Spring Framework 5.3.17. In the environment of JDK 11, Spring MVC, Apache Tomcat 9.0.60, and traditional WAR deployment, the class.module.name property path was determined to be readable.

The post-remediation project upgraded Spring Framework to 5.3.18. The same property path became unreadable, while the normal data binding functionality for name and email remained usable.

This project did not perform full remote code exploitation; instead, it completed differential verification before and after remediation through a safe, controlled read-only method.

The project highlights the following capabilities:

  • Basic environment setup for Java and Spring MVC
  • Maven project building
  • Tomcat WAR application deployment
  • Understanding of Spring data binding mechanism
  • Vulnerability impact condition analysis
  • Security test process design
  • Component version upgrade
  • Post-remediation re-testing
  • Normal functionality regression testing
  • Security test report writing
  • Screenshot evidence and GitHub project organization
Download Tool