Skip to content

CVE-2025-24813: Verified Repro With Script Download

CVE-2025-24813: Apache Tomcat partial PUT session deserialization RCE

CVE-2025-24813 is verified against Apache Tomcat · maven. Vulnerability class: RCE. This critical reproduction includes runnable sandbox proof, artifacts, and a plain-text agent view under REPRO-2026-00282.

REPRO-2026-00282 Apache Tomcat · maven RCE Jul 11, 2026 CVE entry ↗ .txt
Severity
CRITICAL
CVSS
9.8
Confidence
HIGH
Reproduced in
42m 34s
Tool calls
240
Spend
$7.43
01 · Overview

What Is CVE-2025-24813?

CVE-2025-24813 is a high-severity remote code execution vulnerability in Apache Tomcat's DefaultServlet partial PUT handling combined with PersistentManager/FileStore session deserialization. Under specific non-default configuration, an attacker can get Tomcat to deserialize an attacker-supplied session file and execute a command. Pruva reproduced it (reproduction REPRO-2026-00282).

02 · Severity & CVSS

CVE-2025-24813 Severity & CVSS Score

CVE-2025-24813 is rated critical severity, with a CVSS base score of 9.8 out of 10.

CRITICAL threat level
9.8 / 10 CVSS base
Weakness CWE-44

Critical — the most severe class — typically remotely exploitable with severe impact. Treat as an emergency.

How to Reproduce CVE-2025-24813

$ pruva-verify REPRO-2026-00282
or curl -O https://pruva.dev/api/v1/reproductions/REPRO-2026-00282/artifacts/bundle/repro/reproduction_steps.sh && chmod +x reproduction_steps.sh && ./reproduction_steps.sh
Run in a VM or disposable container. This exploits a real vulnerability.
06 · Proof of Reproduction

Proof of Reproduction for CVE-2025-24813

Remote code execution — reproduced
  • reached the target end-to-end
  • full exploit chain demonstrated
  • on the real production code path
  • high confidence
  • the upstream fix blocks the same trigger
Trigger

HTTP PUT path/body with Content-Range and Cookie JSESSIONID=.payload

Attack chain
  1. DefaultServlet partial PUT to /payload.session, then PersistentManager/FileStore session load on GET /index.jsp
How the agent worked 587 events · 240 tool calls · 43 min
43 minDuration
240Tool calls
151Reasoning steps
587Events
5Dead-ends
Agent activity over 43 min
Support
27
Hypothesis
3
Repro
482
Judge
70
0:0042:34

Root Cause and Exploit Chain for CVE-2025-24813

Versions: Official Tomcat 10 security notes list CVE-2025-24813 as affecting Apache Tomcat 10.1.0-M1 through 10.1.34 and fixed in 10.1.35. Equivalent 9.x and 11.x ranges are also covered by the upstream advisory, but this run tested the Tomcat 10.1 line only.

A real Apache Tomcat runtime code-execution path was reproduced via the DefaultServlet partial PUT implementation present in Tomcat 10.1.34. With the documented non-default preconditions enabled (readonly=false on the DefaultServlet, partial PUT support, Tomcat PersistentManager plus FileStore session persistence, and a deserialization gadget class available to the web application), an unauthenticated HTTP client can upload a serialized session object with a Content-Range PUT to /payload.session. Tomcat 10.1.34 stores the attacker-controlled body as work/Catalina/localhost/ROOT/.payload.session; a follow-up request carrying Cookie: JSESSIONID=.payload causes Tomcat to deserialize that file and execute the attacker-controlled command. Tomcat 10.1.35, the fixed negative control, does not create the FileStore session file and does not execute the command.

  • Package/component affected: Apache Tomcat 10.1.x, specifically DefaultServlet partial PUT handling interacting with org.apache.catalina.session.PersistentManager / FileStore session deserialization.
  • Affected versions: Official Tomcat 10 security notes list CVE-2025-24813 as affecting Apache Tomcat 10.1.0-M1 through 10.1.34 and fixed in 10.1.35. Equivalent 9.x and 11.x ranges are also covered by the upstream advisory, but this run tested the Tomcat 10.1 line only.
  • Risk level and consequences: High/Critical under the documented preconditions. A remote unauthenticated attacker can turn a writable DefaultServlet partial PUT into attacker-controlled session-file creation and then trigger Java deserialization in the web application classloader. The demonstrated consequence is command execution as the Tomcat process user.

Impact Parity

  • Disclosed/claimed maximum impact: Code execution / RCE in Apache Tomcat from a remote HTTP entrypoint.
  • Reproduced impact from this run: Full code execution was demonstrated. The proof payload executed /bin/sh -c id > bundle/repro/vuln_rce_marker.txt from Tomcat deserialization, producing uid=1000(vscode) gid=1000(vscode) groups=1000(vscode).
  • Parity: full.
  • Not demonstrated: The run did not demonstrate internet-scale exploitation against a default Tomcat installation. The exploit requires the known non-default preconditions: DefaultServlet writes enabled, file-backed session persistence, and a deserialization-capable application/library class. The proof uses a deliberately deployed minimal webapp gadget class to make the deserialization effect deterministic and safe.

Root Cause

Tomcat's vulnerable partial PUT implementation used a temporary/file-store name derived from the user-provided request path by replacing path separators with dots. When the DefaultServlet was writable, a PUT /payload.session request with a Content-Range header could write the attacker-controlled body to a file whose path overlapped Tomcat's default FileStore session location: work/Catalina/localhost/ROOT/.payload.session.

When the application used PersistentManager with the default FileStore, Tomcat looked up session ID .payload as that same file. A subsequent request with Cookie: JSESSIONID=.payload caused Tomcat to load and deserialize the attacker-written object using the web application's classloader. If the application classpath contained a gadget that performs attacker-influenced behavior during deserialization, this became code execution.

Upstream documents this as CVE-2025-24813 and states it was fixed in Apache Tomcat 10.1.35 by commit f6c01d6577cf9a1e06792be47e623d36acc3b5dc.

Reproduction Steps

  1. Reference script: bundle/repro/reproduction_steps.sh.
  2. The script is self-contained for this bundle. It:
    • downloads official Apache Tomcat 10.1.34 and 10.1.35 binary tarballs if not already cached under the bundle;
    • compiles a minimal serializable webapp gadget class whose readObject() executes a supplied command;
    • configures both Tomcat instances with DefaultServlet readonly=false, PersistentManager, and FileStore;
    • deploys the gadget class and a session-enabled index.jsp into each ROOT webapp;
    • starts both real Tomcat servers on local HTTP ports;
    • sends real unauthenticated HTTP PUT /payload.session requests with Content-Range: bytes 0-5/100;
    • triggers session loading with GET /index.jsp and Cookie: JSESSIONID=.payload;
    • checks that the vulnerable Tomcat creates bundle/repro/vuln_rce_marker.txt while the fixed Tomcat does not create bundle/repro/fixed_rce_marker.txt.
  3. Expected evidence: Tomcat 10.1.34 returns PUT 201, trigger 500, creates the FileStore session file and writes the id command output marker. Tomcat 10.1.35 returns PUT 201 for an ordinary webapp resource, trigger 200, does not create the FileStore .payload.session, and does not create the marker.

Evidence

  • Primary proof log: bundle/logs/cve2025_24813_requests.log.
  • Consecutive script run logs: bundle/logs/repro_rce_run1.log, bundle/logs/repro_rce_run2.log.
  • Vulnerable Tomcat server log: bundle/logs/tomcat-10.1.34-catalina.out.
  • Fixed Tomcat server log: bundle/logs/tomcat-10.1.35-catalina.out.
  • Runtime manifest: bundle/repro/runtime_manifest.json.
  • Code execution marker: bundle/repro/vuln_rce_marker.txt.

Key evidence excerpt from the final run:

vulnerable-10.1.34 PUT /payload.session Content-Range status: 201
vulnerable-10.1.34 GET /index.jsp Cookie:JSESSIONID=.payload status: 500
fixed-10.1.35 PUT /payload.session Content-Range status: 201
fixed-10.1.35 GET /index.jsp Cookie:JSESSIONID=.payload status: 200
vulnerable work session created: true
fixed work session created: false
vulnerable marker: uid=1000(vscode) gid=1000(vscode) groups=1000(vscode)
fixed marker: <absent>
CONFIRMED: vulnerable Tomcat executed attacker-controlled command: uid=1000(vscode) gid=1000(vscode) groups=1000(vscode)

Environment details captured by the script include Apache Tomcat 10.1.34 and 10.1.35 startup logs, OpenJDK runtime information in catalina.out, and real HTTP request/response header artifacts under bundle/logs/.

Recommendations / Next Steps

  • Upgrade affected Tomcat deployments to Apache Tomcat 10.1.35 or later for the 10.1 branch; apply the corresponding fixed release for 9.x or 11.x deployments.
  • Keep the DefaultServlet readonly setting at its safe default (true) unless writes are strictly required and strongly authenticated/authorized.
  • Disable partial PUT support if it is not required by the application.
  • Avoid file-based session persistence at the default FileStore location when it is not required; prefer safer session storage designs.
  • Treat application classpath deserialization gadgets as security-sensitive. Add Java serialization filters and remove libraries/classes that are unsafe during deserialization.
  • Regression-test that Content-Range PUTs cannot create files in work/Catalina/.../.<session>.session and that JSESSIONID=.<name> cannot load attacker-written files.

Additional Notes

  • Idempotency: Confirmed. bundle/repro/reproduction_steps.sh was executed twice after the final fix and exited 0 both times with the same vulnerable-vs-fixed divergence and command-execution marker.
  • Negative controls: Tomcat 10.1.35 was configured with the same webapp and operational preconditions, but the exploit did not create the FileStore session file and did not execute the command.
  • Related cleared lead: The previous attempt's Tomcat 10.1.55 security-constraint/DefaultServlet PUT bypass was extended toward JSP upload RCE, but direct .jsp and classic trailing-slash variants did not produce executable JSP upload on this current Tomcat path. The confirmed RCE path is therefore the partial PUT session deserialization chain against 10.1.34.

CVE-2025-24813 Reproduction Transcript

The agent's step-by-step process — every tool call, every handoff, the moment the exploit fired.

Full session Replay every step — scrub the timeline or play it back.

Event 1/40
0:004:26
0:00
session startedgpt-5.5 · HUNT-APACHE-TOMCAT-20260710 · REPRO-20
0:06
0:08
web search
0:18
0:20
0:22
0:25
0:34
0:36
web search
0:37
web search
0:39
web search
0:49
0:49
0:50
web search
0:51
web search
0:53
web search
2:23
2:23
2:23
2:23
2:23
extract_facts
no facts extracted
2:25
2:25
supportrepro
4:20
4:20
4:23
4:23
4:23
4:24
4:26
4:26
08 · How to Fix

How to Fix CVE-2025-24813

Coming soon

Step-by-step mitigation and hardening guidance for CVE-2025-24813 — configuration checks, workarounds where no patch exists, and how to verify you're protected — is on the way.

10 · FAQ

FAQ: CVE-2025-24813

Is CVE-2025-24813 exploitable on a default Tomcat installation?

No. Exploitation requires non-default configuration: readonly=false on the DefaultServlet, partial PUT support enabled, PersistentManager with FileStore session persistence configured, and a deserialization gadget class reachable from the web application's classpath.

How severe is CVE-2025-24813?

It is rated high severity: under the documented preconditions, an unauthenticated HTTP client can turn a session-file write into arbitrary command execution on the Tomcat server.

How can I reproduce CVE-2025-24813?

Download the verified script from this page and run it in an isolated environment against Tomcat 10.1.34 configured with readonly=false, partial PUT enabled, and PersistentManager/FileStore session persistence. It PUTs a serialized session object with a Content-Range header to /payload.session, then sends a request with Cookie: JSESSIONID=.payload to trigger deserialization and command execution, and confirms Tomcat 10.1.35 does not create the FileStore session file or execute the command.
11 · References

References for CVE-2025-24813

Authoritative sources for CVE-2025-24813 — official vulnerability databases and the upstream advisory. Pruva's reproduction verifies the issue firsthand; these are the primary records to corroborate it.