Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2025-24813 PoC — Apache Tomcat: Potential RCE and/or information disclosure and/or information corruption with partial PUT

Source
Associated Vulnerability
Title:Apache Tomcat: Potential RCE and/or information disclosure and/or information corruption with partial PUT (CVE-2025-24813)
Description:Path Equivalence: 'file.Name' (Internal Dot) leading to Remote Code Execution and/or Information disclosure and/or malicious content added to uploaded files via write enabled Default Servlet in Apache Tomcat. This issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.2, from 10.1.0-M1 through 10.1.34, from 9.0.0.M1 through 9.0.98. The following versions were EOL at the time the CVE was created but are known to be affected: 8.5.0 though 8.5.100. Other, older, EOL versions may also be affected. If all of the following were true, a malicious user was able to view security sensitive files and/or inject content into those files: - writes enabled for the default servlet (disabled by default) - support for partial PUT (enabled by default) - a target URL for security sensitive uploads that was a sub-directory of a target URL for public uploads - attacker knowledge of the names of security sensitive files being uploaded - the security sensitive files also being uploaded via partial PUT If all of the following were true, a malicious user was able to perform remote code execution: - writes enabled for the default servlet (disabled by default) - support for partial PUT (enabled by default) - application was using Tomcat's file based session persistence with the default storage location - application included a library that may be leveraged in a deserialization attack Users are recommended to upgrade to version 11.0.3, 10.1.35 or 9.0.99, which fixes the issue.
Description
POC for CVE-2025-24813 using Spring-Boot
Readme
# CVE-2025-24813: Apache 

## 1. Explanation
Tomcat is vulnerable because of two separate vulnerabilities, the first is a weakness in the DefaultServlet which allows partial puts to write a temp directory
see:
https://github.com/apache/tomcat/blob/f2a274bc00cf73670a614999561c69a391b5e35f/java/org/apache/catalina/servlets/DefaultServlet.java#L608 

The second is the FileStore class, which deserializes any .session file in the temp directory
see:
https://github.com/apache/tomcat/blob/05a72ef525e41835aaf5ce3d04122970f4aa8c21/java/org/apache/catalina/session/FileStore.java#L202 

## 2. Vulnerable Tomcat Configuration

The application uses Tomcat 10.1.24 (included in Spring-Boot 3.3.0), which is vulnerable to CVE-2025-24813, and configures it with:

- File-based session persistence using `PersistentManager` and `FileStore`
- Re-enable the defaultServlet(`server.servlet.register-default-servlet=true`)
- Read-only mode disabled for the default servlet (`readonly=false`)

## 3. Nuclei Template command
See template: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-24813.yaml 
cooldown period 60 seconds is needed since it takes a while before the Filestore handler picks up the session file and executes the payload:
`nuclei -target http://localhost:8080/ -t http/cves/2025/CVE-2025-24813.yaml -interactions-cooldown-period 60 -v`
File Snapshot

[4.0K] /data/pocs/8f58330dd223ac2f658c4a2a25db583aba632b73 ├── [ 10K] mvnw ├── [6.9K] mvnw.cmd ├── [1.6K] pom.xml ├── [1.3K] README.md └── [4.0K] src ├── [4.0K] main │   ├── [4.0K] java │   │   └── [4.0K] com │   │   └── [4.0K] example │   │   └── [4.0K] tomcatcve202524813 │   │   ├── [1.1K] ServletConfig.java │   │   ├── [2.0K] TomcatConfiguration.java │   │   ├── [ 359] TomcatCve202524813Application.java │   │   └── [ 498] WebConfiguration.java │   └── [4.0K] resources │   └── [ 575] application.properties └── [4.0K] test └── [4.0K] java └── [4.0K] com └── [4.0K] example └── [4.0K] tomcatcve202524813 └── [ 243] TomcatCve202524813ApplicationTests.java 12 directories, 10 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →