Zum Hauptinhalt springen
LIVE Intel Feed
"Not a Pentest" Notice: Remediation guide for your own Tomcat infrastructure only.
Academy · CVE FeedCRITICAL · CVSS 9.8

CVE-2024-56337

Apache Tomcat — Partial PUT Race Condition → RCE

Impact: Race condition in Apache Tomcat's Partial PUT handling (when readonly=false) enables unauthenticated attackers to upload JSP webshells and achieve Remote Code Execution. Affects Tomcat 9.0.x / 10.1.x / 11.0.x. Only exploitable when DefaultServlet readonly=false — check your web.xml immediately. Patch to 9.0.99 / 10.1.35 / 11.0.3.

9.8
CVSS Score
CRITICAL
Severity
RCE
Impact
readonly=true
Quick mitigation

Step-by-Step Fix Runbook

1
Identify Tomcat version and Partial PUT configuration
# Find Tomcat version
find / -name "catalina.jar" 2>/dev/null | head -5
# Then:
java -cp /path/to/catalina.jar org.apache.catalina.util.ServerInfo

# Or check version file:
cat /opt/tomcat/RELEASE-NOTES | head -5
cat /usr/share/tomcat*/lib/catalina.jar.version 2>/dev/null

# Check if Partial PUT is enabled (required for exploitation):
grep -r "readonly" /opt/tomcat/conf/web.xml
# Look for DefaultServlet configuration:
# <init-param>
#   <param-name>readonly</param-name>
#   <param-value>false</param-value>   <-- Partial PUT enabled, exploitable
# </init-param>

# VULNERABLE: Tomcat 11.0.0-M1 to 11.0.2, 10.1.0-M1 to 10.1.34, 9.0.0.M1 to 9.0.98
# AND readonly=false in DefaultServlet
2
Upgrade Apache Tomcat to patched version
# Download patched version from Apache:
# Tomcat 11: >= 11.0.3
# Tomcat 10: >= 10.1.35
# Tomcat  9: >= 9.0.99

# Example: upgrade Tomcat 10 on Linux
TOMCAT_VERSION="10.1.35"
cd /opt
wget https://downloads.apache.org/tomcat/tomcat-10/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz

# Verify checksum (CRITICAL — verify against Apache's published checksum):
sha512sum apache-tomcat-$TOMCAT_VERSION.tar.gz
# Compare with: https://downloads.apache.org/tomcat/tomcat-10/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz.sha512

# Stop current Tomcat, backup, extract, start new version
systemctl stop tomcat
cp -r /opt/tomcat /opt/tomcat.bak
tar xzf apache-tomcat-$TOMCAT_VERSION.tar.gz
# ... update symlink/service config to new version
systemctl start tomcat
3
Immediate mitigation: disable Partial PUT if not needed
# If Partial PUT is not required, disable it immediately:
# Edit /opt/tomcat/conf/web.xml — find DefaultServlet config:

# Change:
# <init-param>
#   <param-name>readonly</param-name>
#   <param-value>false</param-value>
# </init-param>

# To:
# <init-param>
#   <param-name>readonly</param-name>
#   <param-value>true</param-value>   <-- Disables PUT/DELETE (and Partial PUT)
# </init-param>

# Restart Tomcat after change:
systemctl restart tomcat

# Verify PUT is disabled (should return 403):
curl -X PUT http://localhost:8080/test.jsp -d "test" -v
# Expected: HTTP/1.1 403 Forbidden
4
Detect exploitation attempts
# Check Tomcat access logs for suspicious PUT requests:
grep -i "PUT" /opt/tomcat/logs/localhost_access_log*.txt | grep -v "403\|401"
# Suspicious: PUT requests returning 200/201 with .jsp extension

# Check for uploaded JSP files in webapps:
find /opt/tomcat/webapps -name "*.jsp" -newer /opt/tomcat/conf/web.xml
# Any new JSP files created recently may be webshells

# Check for webshell indicators:
grep -r "Runtime.exec\|ProcessBuilder\|cmd.exe\|/bin/sh" /opt/tomcat/webapps/ --include="*.jsp"

# Falco rule for Tomcat exploitation:
# Alert on: new file creation in tomcat webapps dir + subsequent process spawn from tomcat
5
WAF rule to block malicious Partial PUT patterns
# Nginx: block PATCH/PUT to JSP/JSPX paths
location ~* \.(jsp|jspx|do|action)$ {
    limit_except GET POST HEAD {
        deny all;
    }
}

# ModSecurity rule for Tomcat Partial PUT attack pattern:
SecRule REQUEST_METHOD "^(PUT|PATCH)$" \
    "id:9001,phase:1,deny,status:403,log,\
    msg:'Blocked PUT/PATCH to server',\
    chain"
SecRule REQUEST_URI "\.(jsp|jspx|do|action)$" ""

# AWS WAF: Create rule to block PUT to *.jsp URIs
# Azure Front Door: Custom rule to deny PUT method to JSP paths

Frequently Asked Questions

What exactly is the Partial PUT vulnerability in Tomcat?

HTTP Partial PUT (Content-Range header) allows uploading large files in chunks. Apache Tomcat's DefaultServlet, when configured with readonly=false, accepts Partial PUT requests. CVE-2024-56337 exploits a race condition in how Tomcat handles partially-uploaded files: during the partial upload process, Tomcat creates a temporary file. If an attacker can win the race condition between the temporary file creation and its processing, they can upload a JSP file to the webapps directory. Once a JSP file is in the webapps directory, Tomcat automatically serves and executes it — giving the attacker Remote Code Execution.

Is my Tomcat installation vulnerable if readonly is not set to false?

No. CVE-2024-56337 requires two conditions BOTH to be true: 1) Tomcat version <= 11.0.2 / <= 10.1.34 / <= 9.0.98. 2) DefaultServlet readonly parameter set to false. The default value of readonly is true — meaning default Tomcat installations are NOT vulnerable. You are only vulnerable if you explicitly enabled readonly=false in your DefaultServlet configuration (typically done to enable WebDAV or file upload via PUT). Check your web.xml immediately if you're unsure.

Which Java versions affect the race condition exploitability?

The exploitability of the race condition varies by JDK version: JDK 8 or JDK 11 without specific system property settings: exploitable. JDK 17+: the race condition is harder to exploit due to improved file handling, but the vulnerability still exists — patch regardless. Tomcat's fix in 11.0.3/10.1.35/9.0.99 addresses the root cause at the Tomcat level, independent of JDK version. Do not rely on JDK version as a mitigation — patch Tomcat.

Does this affect Spring Boot embedded Tomcat?

Spring Boot embeds Tomcat as the default web server. For Spring Boot applications: The DefaultServlet readonly=false configuration is not typically enabled in Spring Boot apps. Spring Boot's static resource handling uses a different mechanism. However: if your Spring Boot app explicitly configures a DefaultServlet with readonly=false, you may be affected. Check for DefaultServlet configuration in your Spring Boot app's WebMvcConfigurer or web.xml. More likely: if you run a standalone Tomcat deployment with WAR files, check that configuration.

Further Resources

🔒 Quantum-Resistant Mycelium Architecture
🛡️ Kuratierte Runbooks – EU-gehostet in Frankfurt
🌐 Zero Known Breaches – Powered by Living Intelligence
🏛️ DSGVO Art. 25 & 32 • SOC 2 & ISO 27001 in Vorbereitung
⚡ Real-Time Global Mycelium Network – 347 Bedrohungen in 60 Minuten
🧬 Trusted by SecOps Leaders worldwide