CVE-2025-24813
Apache Tomcat — Partial PUT Remote Code Execution (CVSS 9.8)
Impact: Remote code execution via HTTP partial PUT in Apache Tomcat DefaultServlet. Requires partial PUT to be explicitly enabled (non-default). Patch: Tomcat 11.0.3 / 10.1.35 / 9.0.99. Check your configuration before assuming you are not affected.
Step-by-Step Fix Runbook
# Check Tomcat version: # Method 1: Tomcat startup log grep -i "Apache Tomcat" /var/log/tomcat*/catalina.out | head -5 # Or: cat /opt/tomcat/RELEASE-NOTES | head -5 # Method 2: Server info endpoint (if enabled): curl -s http://localhost:8080/ | grep -i tomcat # Method 3: JAR manifest: unzip -p /opt/tomcat/lib/catalina.jar META-INF/MANIFEST.MF | grep Implementation-Version # Affected versions: # Apache Tomcat 11.0.0-M1 through 11.0.2 # Apache Tomcat 10.1.0-M1 through 10.1.34 # Apache Tomcat 9.0.0.M1 through 9.0.98 # (Earlier branches may also be affected if partial PUT enabled) # NOT affected: # Tomcat 11.0.3+ # Tomcat 10.1.35+ # Tomcat 9.0.99+ # Tomcat with partial PUT disabled (default in most configs)
# CVE-2025-24813 requires partial PUT to be enabled # This is NOT the default in Tomcat — check if explicitly enabled # Check conf/web.xml for DefaultServlet partial PUT config: grep -n "readonly|allowPartialPut|partialPut" /opt/tomcat/conf/web.xml # Vulnerable configuration looks like: # <init-param> # <param-name>readonly</param-name> # <param-value>false</param-value> ← write enabled # </init-param> # combined with: # <init-param> # <param-name>allowPartialPut</param-name> # <param-value>true</param-value> ← partial PUT enabled # </init-param> # If readonly=true (default) AND allowPartialPut=false (default): # You are NOT directly exploitable via this path # Still patch — defense in depth # Also check application-specific web.xml files: find /opt/tomcat/webapps -name "web.xml" | xargs grep -l "allowPartialPut|readonly" 2>/dev/null
# Download patched version from https://tomcat.apache.org/download-11.cgi
# For Tomcat 11.x — upgrade to 11.0.3+:
TOMCAT_VERSION=11.0.3
wget https://downloads.apache.org/tomcat/tomcat-11/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz
wget https://downloads.apache.org/tomcat/tomcat-11/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz.sha512
sha512sum -c apache-tomcat-${TOMCAT_VERSION}.tar.gz.sha512 # Verify integrity
# For Tomcat 10.1.x — upgrade to 10.1.35+:
TOMCAT_VERSION=10.1.35
wget https://downloads.apache.org/tomcat/tomcat-10/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz
# For Tomcat 9.0.x — upgrade to 9.0.99+:
TOMCAT_VERSION=9.0.99
wget https://downloads.apache.org/tomcat/tomcat-9/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz
# Docker: update base image
# FROM tomcat:11.0.3-jdk21 (patched)
# FROM tomcat:10.1.35-jdk21 (patched)
# FROM tomcat:9.0.99-jdk11 (patched)
# Kubernetes: rolling update
kubectl set image deployment/tomcat-app tomcat=tomcat:11.0.3-jdk21
kubectl rollout status deployment/tomcat-app# If immediate patching is not possible:
# Disable partial PUT in conf/web.xml DefaultServlet configuration
# Edit /opt/tomcat/conf/web.xml — find DefaultServlet section and set:
# <init-param>
# <param-name>allowPartialPut</param-name>
# <param-value>false</param-value> ← Explicitly disable
# </init-param>
# <init-param>
# <param-name>readonly</param-name>
# <param-value>true</param-value> ← Ensure writes disabled
# </init-param>
# Also block PUT method at reverse proxy/WAF (defense in depth):
# Nginx:
location / {
limit_except GET POST HEAD {
deny all;
}
}
# Apache HTTPD (as reverse proxy):
# <LimitExcept GET POST HEAD OPTIONS>
# Deny from all
# </LimitExcept>
# Restart Tomcat after config changes:
systemctl restart tomcat
# Verify PUT is blocked:
curl -X PUT http://localhost:8080/test.jsp -d "test"
# Should return 403 or 405# Scan Tomcat webapps directory for suspicious uploaded files:
find /opt/tomcat/webapps -name "*.jsp" -newer /opt/tomcat/conf/web.xml -mtime -30 |
xargs grep -l "Runtime.exec|ProcessBuilder|getRuntime|exec(" 2>/dev/null
# Check Tomcat access log for PUT requests:
grep -E '"PUT ' /var/log/tomcat*/localhost_access*.log | grep -v "405|403"
# Any successful PUT (200, 201, 204) to a .jsp or .jspx path = investigate
# Check for partial PUT temp files (attack staging area):
find /opt/tomcat -name "*.tmp" -newer /opt/tomcat/conf -mtime -7 2>/dev/null |
file {} | grep -i "java|class|jsp"
# Check for unexpected connections from Tomcat JVM:
ss -tlnp | grep java
netstat -tlnp | grep java
# Look for unexpected listening ports or outbound connections
# Review catalina.out for deserialization or classloading anomalies:
grep -E "ClassLoader|ClassCast|Deserializ|java.lang.reflect" \
/var/log/tomcat*/catalina.out | tail -50Frequently Asked Questions
What is a partial PUT request and why does it cause RCE in Tomcat?
HTTP PUT is used to upload a resource to a specific URL. Partial PUT (defined in RFC 7233) allows uploading a file in chunks — each chunk uses a Content-Range header. Apache Tomcat's DefaultServlet, when configured with allowPartialPut=true and readonly=false, stores partial PUT chunks in a temporary location before assembling the final file. The vulnerability: the temporary storage path is predictable and the chunk is stored as-is before full assembly. An attacker can: 1) Send a partial PUT request with a JSP webshell as the chunk body — Tomcat stores it in a temp location. 2) Access the temporary file via a crafted HTTP request before assembly completes. 3) The JSP executes in the context of the Tomcat process — typically with the service account's privileges. This is why the attack requires partial PUT to be enabled and write access to be allowed — both non-default settings.
How is CVE-2025-24813 different from CVE-2024-56337 (also an Apache Tomcat RCE)?
Both are Apache Tomcat RCE vulnerabilities but with different root causes: CVE-2024-56337 (patched in Dec 2024): race condition in partial PUT on case-insensitive file systems (Windows, macOS). Required: partial PUT enabled, case-insensitive OS, file system write access. CVE-2025-24813 (patched in March 2025): different code path in partial PUT handling — exploitable even on case-sensitive Linux file systems. Lower exploitation complexity than CVE-2024-56337. Required: partial PUT enabled, write access (readonly=false). Key difference: CVE-2025-24813 is more broadly exploitable — it works on Linux where CVE-2024-56337 primarily affected Windows deployments. If you patched for CVE-2024-56337 in December 2024 but didn't re-patch in March 2025, you may still be vulnerable to CVE-2025-24813.
Is partial PUT commonly enabled in Tomcat deployments?
No — partial PUT is NOT enabled by default in Apache Tomcat. The default configuration has: readonly=true (no write operations via PUT/DELETE), allowPartialPut=false (no chunked uploads). However, these defaults can be changed by: 1) Application developers who need file upload capability via HTTP PUT (document management applications, WebDAV-like APIs). 2) Framework configurations (some older Spring or JAX-RS setups that use DefaultServlet for static content with writes). 3) Misconfigured server setups where write capability was enabled for testing and never disabled in production. Risk assessment: if you've never explicitly enabled partial PUT, your default Tomcat deployment is not directly exploitable via this specific attack path. Patching is still strongly recommended — future exploit chaining possibilities and defense in depth. Check your web.xml as shown in Step 2.
What versions of Java are affected alongside Tomcat?
CVE-2025-24813 is a Tomcat-level vulnerability — the Java version is not the determining factor. Any JDK version paired with a vulnerable Tomcat version can be affected. However, Java version does affect: Deserialization attacks (if chained with deserialization gadgets) — newer Java versions have stronger deserialization protections. Module system (Java 9+): stronger class loading restrictions may limit some post-exploitation pivot techniques. Recommended Java versions alongside patched Tomcat: Tomcat 11.0.3+: JDK 21 LTS (latest LTS, recommended). Tomcat 10.1.35+: JDK 17 LTS or JDK 21 LTS. Tomcat 9.0.99+: JDK 11 LTS minimum (JDK 8 end of life for most distributions). Avoid running Tomcat on end-of-life JDK versions regardless of this CVE — they lack security patches for JDK-level vulnerabilities.