CVE-2025-31651 Apache Tomcat: Bypass of rules in Rewrite Valve

Critical 9.8 Published Updated

Attackers can bypass security constraints enforced by specific Rewrite Valve rules in Apache Tomcat via crafted requests.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-31651?

CVE-2025-31651 is a critical vulnerability in Apache Tomcat, published on 28 Apr 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in Apache Tomcat. For a subset of unlikely rewrite rule configurations, it was possible for a specially crafted request to bypass some rewrite rules. If those rewrite rules effectively enforced security constraints, those constraints could be bypassed.

This issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.5, from 10.1.0-M1 through 10.1.39, from 9.0.0.M1 through 9.0.102. The following versions were EOL at the time the CVE was created but are known to be affected: 8.5.0 though 8.5.100. Other, older, EOL versions may also be affected.

Users are recommended to upgrade to version [FIXED_VERSION], which fixes the issue.

Weakness: CWE-116

Which versions are affected by CVE-2025-31651?

17 open source packages ship an affected version, including org.apache.tomcat.embed:tomcat-embed-core, tomcat and org.apache.tomcat:tomcat-catalina. It affects 1 product.

PackageAffectedFixed in
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 10.1.1010.1.40
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 10.1.1010.1.40
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 11.0.0-M211.0.6
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 11.0.0-M211.0.6
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 8.5.0 to 8.5.100None
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 8.5.0 to 8.5.100None
11 more packages
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 9.0.769.0.104
org.apache.tomcat.embed:tomcat-embed-core MavenFrom 9.0.769.0.104
tomcat BitnamiAll versions9.0.104, 10.1.40, 11.0.6
org.apache.tomcat:tomcat-catalina MavenFrom 10.1.1010.1.40
org.apache.tomcat:tomcat-catalina MavenFrom 10.1.1010.1.40
org.apache.tomcat:tomcat-catalina MavenFrom 11.0.0-M211.0.6
org.apache.tomcat:tomcat-catalina MavenFrom 11.0.0-M211.0.6
org.apache.tomcat:tomcat-catalina MavenFrom 8.5.0 to 8.5.100None
org.apache.tomcat:tomcat-catalina MavenFrom 8.5.0 to 8.5.100None
org.apache.tomcat:tomcat-catalina MavenFrom 9.0.769.0.104
org.apache.tomcat:tomcat-catalina MavenFrom 9.0.769.0.104
Linux distribution packages (1)
tomcat SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5All versions9.0.36-3.142.1

Products include Apache Tomcat.

How do I fix CVE-2025-31651?

Upgrade org.apache.tomcat.embed:tomcat-embed-core to a fixed version for your release line: 10.1.40, 11.0.6 or 9.0.104.

Is CVE-2025-31651 being exploited?

There is no known exploitation of CVE-2025-31651 in the wild and no public exploit code.

Public exploit code: 2 proofs of concept on GitHub.

All Apache Tomcat vulnerabilities

Sources

Also known as BIT-tomcat-2025-31651, CLEANSTART-2026-EV68545, CLSA-2025-1750780819, CLSA-2025-1750785145, CLSA-2025-1752087582, CLSA-2025-1761576180 and 10 more.

Is CVE-2025-31651 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free