CVE-2025-31651

Command Injection
Affects
Apache Tomcat
in
Apache Tomcat
No items found.
Versions
>=9.0.76 <9.0.104, >=10.1.10 <10.1.40, >=11.0.0-M2 <11.0.6
Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs

Overview

Apache Tomcat is an open-source web server and servlet container developed by the Apache Software Foundation. It implements several Java Enterprise Edition (Java EE) specifications including Java Servlet, JavaServer Pages (JSP), and WebSocket, allowing it to run Java web applications. Tomcat is widely used in both development and production environments due to its lightweight nature, ease of configuration, and compatibility with various Java applications. 

An Improper Encoding or Escaping of Output / Improper Neutralization of Leading Special Elements vulnerability (CVE-2025-31651) has been identified in Apache Tomcat. This vulnerability allows certain rewrite rules to be bypassed under certain configurations. When those rewrite rules are used for security, those security methods are susceptible to bypass as well.

Per Mitre: An Information Disclosure vulnerability is a security flaw that allows unauthorized users to access sensitive information that should be kept private.

Per Mitre: An Improper Neutralization of Leading Special Elements vulnerability is a security flaw that can cause a process to take unexpected actions when leading special elements are improperly handled.

This issue affects multiple versions of Apache Tomcat below 11.0.6.

Details

Module Info

  • Product: Apache Tomcat
  • Affected packages: tomcat-embed-core, tomcat-catalina
  • Affected versions: >=9.0.76 <9.0.104, >=10.1.10 <10.1.40, >=11.0.0-M2 <11.0.6
  • GitHub repository: https://github.com/apache/tomcat
  • Package manager: Maven
  • Fixed in: NES 8.5.101, 9.0.104, 10.1.40, and 11.0.6

Vulnerability Info

The problem lies in the Tomcat RewriteRule. Under certain unlikely configurations, attackers of vulnerable applications can use characters like ; or ? to bypass rewrite rules, potentially bypassing security constraints and gaining access to protected resources.

Mitigation

Only recent versions of Apache Tomcat are community-supported. The community support version will not receive any updates to address this issue. For more information, see here.

Users of the affected components should apply one of the following mitigations:

  • Upgrade to a patched version of Apache Tomcat.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support.

Credit

  • COSCO Shipping Lines DIC (finder)

Vulnerability Details
ID
CVE-2025-31651
PROJECT Affected
Apache Tomcat
Versions Affected
>=9.0.76 <9.0.104, >=10.1.10 <10.1.40, >=11.0.0-M2 <11.0.6
Published date
August 4, 2025
≈ Fix date
April 1, 2025
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Critical
Category
Command Injection
Sign up for the latest vulnerability alerts fixed in
NES for Apache Tomcat
Rss feed icon
Subscribe via RSS
or

By clicking “submit” I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.