
Local reproduction lab for Apache Tomcat CVE-2025-24813, documenting exploitation conditions and AI-assisted verification of the vulnerability.
For local authorized experiments, patch understanding, and defensive validation only. Do not send requests to unauthorized targets.
This project records the reproduction process of CVE-2025-24813 on a local Apache Tomcat 9.0.98 instance: using partial PUT to write temporary files, and under a configuration with file-based Session persistence enabled and loose deserialization filtering conditions, verifying the Session file loading and Payload execution chain.
.inject.session is successfully written in the working directory, then confirms that access triggers Session loading and Payload execution; success cannot be judged solely by HTTP status codes.409 or 500, but file writing and subsequent triggering still need to be judged in stages based on file contents, server logs, and controlled side effects.The official Apache security advisory lists the trigger prerequisites, affected scope (Tomcat 9.0.0-M1 to 9.0.98), and 9.0.99 fix information for CVE-2025-24813: https://tomcat.apache.org/security-9
java -version)requests127.0.0.1:8080scripts/reproduce_local.py # Local validation script, target defaults to localhost:8080
evidence/ # Experiment screenshots (renamed by step)
python3 -m venv .venv
. .venv/bin/activate
python -m pip install requests
python scripts/reproduce_local.py
The target in the script is fixed to the local experiment address and does not include remote scanning logic. Before running, confirm in the local Tomcat instance:
work/Catalina/localhost/ROOT are observable.PUT /inject/session carries Content-Range, observe whether a temporary file is generated;work/Catalina/localhost/ROOT/.inject.session;JSESSIONID=.inject to access a controlled local page, observe Session file loading;409/500 as either failure or success of vulnerability reproduction.HTTP headers must use real CRLF (bytes 0d 0a); do not send 0x0d0x0a as visible text. In Python, use b"\\r\\n" or let requests construct the request headers.
Prioritize upgrading to a Tomcat version that includes the fix, and re-check Default Servlet write permissions, partial PUT usage scenarios, and Session persistence filter configuration. After the fix, repeat the same set of local validation steps; it is expected that the temporary file write chain or the Session loading chain will no longer hold.
This repository does not provide scanning, persistence, or batch exploitation functionality targeting internet-facing targets. All content is limited to local experiment environments under my own control and explicitly authorized ranges.