CVE-2025-31651

9.8 CRITICAL

📋 TL;DR

This vulnerability in Apache Tomcat allows attackers to bypass security constraints by crafting requests that evade specific rewrite rules. It affects Tomcat versions 9.0.0.M1 through 9.0.102, 10.1.0-M1 through 10.1.39, and 11.0.0-M1 through 11.0.5, plus some EOL versions. Organizations using affected versions with rewrite rules for security enforcement are at risk.

💻 Affected Systems

Products:
  • Apache Tomcat
Versions: 9.0.0.M1 through 9.0.102, 10.1.0-M1 through 10.1.39, 11.0.0-M1 through 11.0.5, plus EOL versions 8.5.0 through 8.5.100
Operating Systems: All platforms running affected Tomcat versions
Default Config Vulnerable: ✅ No
Notes: Only vulnerable with specific rewrite rule configurations that enforce security constraints. Most default configurations are not affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete bypass of authentication, authorization, or access control mechanisms leading to unauthorized data access or system compromise.

🟠

Likely Case

Partial bypass of security controls depending on specific rewrite rule configurations, potentially exposing restricted resources.

🟢

If Mitigated

Limited impact if rewrite rules aren't used for critical security enforcement or if additional layers of security exist.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires knowledge of specific rewrite rule configurations and crafting specialized requests.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 11.0.6, 10.1.40, 9.0.103

Vendor Advisory: https://lists.apache.org/list.html?announce@tomcat.apache.org

Restart Required: Yes

Instructions:

1. Download patched version from Apache Tomcat website. 2. Backup current installation. 3. Stop Tomcat service. 4. Replace Tomcat files with patched version. 5. Restart Tomcat service. 6. Verify version update.

🔧 Temporary Workarounds

Remove or modify rewrite rules

all

Review and remove rewrite rules that enforce security constraints, or replace them with alternative security mechanisms.

Edit server.xml or rewrite configuration files to remove/modify vulnerable rules

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to block suspicious rewrite bypass attempts
  • Add additional authentication/authorization layers independent of rewrite rules

🔍 How to Verify

Check if Vulnerable:

Check Tomcat version and review rewrite rule configurations in server.xml and rewrite configuration files

Check Version:

java -cp "$CATALINA_HOME/lib/catalina.jar" org.apache.catalina.util.ServerInfo

Verify Fix Applied:

Verify Tomcat version is 11.0.6+, 10.1.40+, or 9.0.103+ and test rewrite rule functionality

📡 Detection & Monitoring

Log Indicators:

  • Unusual request patterns that bypass expected URL paths
  • Access to restricted resources without proper authentication logs

Network Indicators:

  • HTTP requests with crafted sequences targeting rewrite rule patterns

SIEM Query:

source="tomcat_access.log" AND (url="*%*" OR url="*\*" OR url="*?*") AND response="200"

🔗 References

📤 Share & Export