cve.bz

CVE-2025-31651 apache tomcat: Improper Encoding or Escaping of Output

9.8 criticalEPSS 4.3%Fix available

Critical (9.8) in apache tomcat. EPSS 4.3% estimated probability of exploitation activity in the next 30 days. Fixed in org.apache.tomcat:tomcat-catalina 10.1.40, 11.0.6, 9.0.104.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
4.3% (unchanged from 4.3% a week ago; 4.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 91st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: total, assessed 2025-07-30. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-116 Improper Encoding or Escaping of Output
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-31651 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-31651?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-31651?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-31651 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Apache Software Foundation Apache Tomcatfrom 11.0.0-M1 through 11.0.5
Apache Software Foundation Apache Tomcatfrom 10.1.0-M1 through 10.1.39
Apache Software Foundation Apache Tomcatfrom 9.0.0.M1 through 9.0.102
Apache Software Foundation Apache Tomcatfrom 8.5.0 through 8.5.100

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-ff77-26x5-69crMavenorg.apache.tomcat:tomcat-catalina>=9.0.76 <9.0.1049.0.104
GHSA-ff77-26x5-69crMavenorg.apache.tomcat:tomcat-catalina>=10.1.10 <10.1.4010.1.40
GHSA-ff77-26x5-69crMavenorg.apache.tomcat:tomcat-catalina>=11.0.0-M2 <11.0.611.0.6
GHSA-ff77-26x5-69crMavenorg.apache.tomcat.embed:tomcat-embed-core>=9.0.76 <9.0.1049.0.104
GHSA-ff77-26x5-69crMavenorg.apache.tomcat.embed:tomcat-embed-core>=10.1.10 <10.1.4010.1.40
GHSA-ff77-26x5-69crMavenorg.apache.tomcat.embed:tomcat-embed-core>=11.0.0-M2 <11.0.611.0.6
GHSA-ff77-26x5-69crMavenorg.apache.tomcat:tomcat-catalina>=8.5.0 <=8.5.100no fix published
GHSA-ff77-26x5-69crMavenorg.apache.tomcat.embed:tomcat-embed-core>=8.5.0 <=8.5.100no fix published

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11tomcat99.0.107-0+deb11u1DLA-4244-1
Debian12, 13, 14tomcat1010.1.40-1DEBIAN-CVE-2025-31651
Debian12, 13, 14tomcat99.0.70-2DEBIAN-CVE-2025-31651
Debian13, 14tomcat1111.0.6-1DEBIAN-CVE-2025-31651
UbuntuPro:16.04:LTStomcat8no fix listedUBUNTU-CVE-2025-31651
UbuntuPro:18.04:LTStomcat8, tomcat9no fix listedUBUNTU-CVE-2025-31651
UbuntuPro:20.04:LTS, Pro:22.04:LTStomcat9no fix listedUBUNTU-CVE-2025-31651
UbuntuPro:24.04:LTStomcat1010.1.16-1ubuntu0.1~esm3UBUNTU-CVE-2025-31651 USN-7705-1
Red Hatenterprise_linux:8::appstreamtomcat, tomcat-lib, tomcat-webapps and 5 more1:9.0.87-1.el8_10.7RHSA-2025:23048
Red Hatenterprise_linux:9::appstreamtomcat, tomcat-lib, tomcat-webapps and 5 more1:9.0.87-6.el9_7.1RHSA-2025:23049
Red Hatenterprise_linux:10.1tomcat, tomcat-lib, tomcat-webapps and 5 more1:10.1.36-3.el10_1.1RHSA-2025:23050
Red Hatenterprise_linux:10.1tomcat9, tomcat9-lib, tomcat9-webapps and 5 more1:9.0.87-8.el10_1.1RHSA-2025:23052
Red Hatenterprise_linux_eus:10.0tomcat, tomcat-lib, tomcat-webapps and 5 more1:10.1.36-1.el10_0.3RHSA-2025:23051
Red Hatenterprise_linux_eus:10.0tomcat9, tomcat9-lib, tomcat9-webapps and 5 more1:9.0.87-5.el10_0.4RHSA-2025:23053
Red Hatjboss_enterprise_web_server:5.8::el7jws5-tomcat, jws5-tomcat-lib, jws5-tomcat-javadoc and 9 more0:9.0.87-14.redhat_00013.1.el7jwsRHSA-2025:22925
Red Hatjboss_enterprise_web_server:5.8::el8jws5-tomcat, jws5-tomcat-lib, jws5-tomcat-javadoc and 7 more0:9.0.87-14.redhat_00013.1.el8jwsRHSA-2025:22925
Red Hatjboss_enterprise_web_server:5.8::el9jws5-tomcat, jws5-tomcat-lib, jws5-tomcat-javadoc and 7 more0:9.0.87-14.redhat_00013.1.el9jwsRHSA-2025:22925
Red Hatjboss_enterprise_web_server:6.1::el8jws6-tomcat, jws6-tomcat-lib, jws6-tomcat-javadoc and 7 more0:10.1.36-19.redhat_00018.1.el8jwsRHSA-2025:19809
Red Hatjboss_enterprise_web_server:6.1::el9jws6-tomcat, jws6-tomcat-lib, jws6-tomcat-javadoc and 7 more0:10.1.36-19.redhat_00018.1.el9jwsRHSA-2025:19809
Red Hatjboss_enterprise_web_server:6.1::el10jws6-tomcat, jws6-tomcat-lib, jws6-tomcat-javadoc and 7 more0:10.1.36-19.redhat_00018.1.el10jwsRHSA-2025:19809
82 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 11 moretomcat9.0.104-150200.81.1SUSE-SU-2025:1521-1
SUSELinux Enterprise High Performance Computing 15 SP5-ESPOS, Linux Enterprise High Performance Computing 15 SP5-LTSS, Linux Enterprise Module for Web and Scripting 15 SP6 and 2 moretomcat1010.1.40-150200.5.40.1SUSE-SU-2025:1537-1
SUSELinux Enterprise Module for Web and Scripting 15 SP7tomcat9.0.104-150200.81.1SUSE-SU-2025:01521-1
SUSELinux Enterprise Module for Web and Scripting 15 SP7tomcat1010.1.40-150200.5.40.1SUSE-SU-2025:01537-1
SUSELinux Enterprise Server 12 SP5-LTSS, Linux Enterprise Server LTSS Extended Security 12 SP5tomcat9.0.115-3.160.1SUSE-SU-2026:1058-1
SUSELinux Enterprise Server LTSS Extended Security 12 SP5tomcat9.0.36-3.142.1SUSE-SU-2025:01882-1
openSUSELeap 15.6tomcat9.0.104-150200.81.1SUSE-SU-2025:1521-1
openSUSELeap 15.6tomcat1010.1.40-150200.5.40.1SUSE-SU-2025:1537-1
openSUSETumbleweedtomcat9.0.104-1.1openSUSE-SU-2025:15048-1
openSUSETumbleweedtomcat1010.1.40-1.1openSUSE-SU-2025:15049-1
AlmaLinux8tomcat, tomcat-lib, tomcat-webapps and 5 more1:9.0.87-1.el8_10.7ALSA-2025:23048
AlmaLinux9tomcat, tomcat-lib, tomcat-webapps and 5 more1:9.0.87-6.el9_7.1ALSA-2025:23049
AlmaLinux10tomcat, tomcat-lib, tomcat-webapps and 5 more1:10.1.36-3.el10_1.1ALSA-2025:23050
AlmaLinux10tomcat9, tomcat9-lib, tomcat9-webapps and 5 more1:9.0.87-8.el10_1.1ALSA-2025:23052
Rocky Linux8tomcat1:9.0.87-1.el8_10.7RLSA-2025:23048
Rocky Linux9tomcat1:9.0.87-6.el9_7.1RLSA-2025:23049
Rocky Linux10tomcat1:10.1.36-3.el10_1.1RLSA-2025:23050
Rocky Linux10tomcat91:9.0.87-8.el10_1.1RLSA-2025:23052

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Low.

Red Hat's statement

This vulnerability is rated as Low severity because it only manifests under a narrow set of conditions involving uncommon and non-default rewrite rule configurations that rely on specific patterns in the raw requestURI, including path parameters. In most deployments, rewrite rules operate on decoded and normalized URIs or are used for non-security-critical purposes like routing. Furthermore, Tomcat’s internal processing already normalizes and removes path parameters (;-delimited) before applying security constraints, meaning any bypass would only be feasible if the rewrite logic directly enforced security (which is a poor practice). The flaw does not allow direct code execution, data leakage, or privilege escalation unless the rewrite rule was explicitly misused as a substitute for proper access control.

Its impact is further mitigated by the fact that rewrite rules are not typically relied upon for access enforcement. As such, while the bug may lead to incorrect rule evaluation under certain edge-case configurations, it does not represent a significant security risk in practice.

Red Hat's mitigation

No mitigation is currently available that meets Red Hat Product Security’s standards for usability, deployment, applicability, or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10tomcat-1:10.1.36-3.el10_1.1Fixed 2025-12-10RHSA-2025:23050
Red Hat Enterprise Linux 10tomcat9-1:9.0.87-8.el10_1.1Fixed 2025-12-10RHSA-2025:23052
Red Hat Enterprise Linux 10.0 Extended Update Supporttomcat-1:10.1.36-1.el10_0.3Fixed 2025-12-10RHSA-2025:23051
Red Hat Enterprise Linux 10.0 Extended Update Supporttomcat9-1:9.0.87-5.el10_0.4Fixed 2025-12-10RHSA-2025:23053
Red Hat Enterprise Linux 8tomcat-1:9.0.87-1.el8_10.7Fixed 2025-12-10RHSA-2025:23048
Red Hat Enterprise Linux 8.2 Advanced Update Supportpki-deps:10.6-8020020260128173505.4cda2c84Fixed 2026-02-16RHSA-2026:2725
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportpki-deps:10.6-8040020260129154709.522a0ee4Fixed 2026-02-16RHSA-2026:2724
Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-Onpki-deps:10.6-8040020260129154709.522a0ee4Fixed 2026-02-16RHSA-2026:2724
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Supportpki-deps:10.6-8060020260128101437.ad008a3aFixed 2026-02-16RHSA-2026:2726
Red Hat Enterprise Linux 8.6 Telecommunications Update Servicepki-deps:10.6-8060020260128101437.ad008a3aFixed 2026-02-16RHSA-2026:2726
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutionspki-deps:10.6-8060020260128101437.ad008a3aFixed 2026-02-16RHSA-2026:2726
Red Hat Enterprise Linux 8.8 Telecommunications Update Servicetomcat-1:9.0.87-1.el8_8.8Fixed 2025-12-10RHSA-2025:23045
Red Hat Enterprise Linux 8.8 Update Services for SAP Solutionstomcat-1:9.0.87-1.el8_8.8Fixed 2025-12-10RHSA-2025:23045
Red Hat Enterprise Linux 9tomcat-1:9.0.87-6.el9_7.1Fixed 2025-12-10RHSA-2025:23049
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutionspki-servlet-engine-1:9.0.43-4.el9_0.2Fixed 2026-01-08RHSA-2026:0292
Red Hat Enterprise Linux 9.2 Update Services for SAP Solutionstomcat-1:9.0.87-1.el9_2.7Fixed 2025-12-10RHSA-2025:23046
Red Hat Enterprise Linux 6tomcat6Out of support scope
Red Hat Enterprise Linux 7tomcatOut of support scope
Red Hat Enterprise Linux 8pki-deps:10.6/pki-servlet-engineFix deferred
Red Hat Enterprise Linux 9pki-servlet-engineAffected
11 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-31651.

GitHub PoC (unverified)

Repositories on GitHub named after this CVE. Nobody has checked them and they are not scanned: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it.

Attack patterns (CAPEC)

  • CAPEC-73 User-Controlled Filename Likelihood: High · Severity: High
  • CAPEC-81 Web Server Logs Tampering Likelihood: Medium · Severity: High
  • CAPEC-85 AJAX Footprinting Likelihood: High · Severity: Low
  • CAPEC-104 Cross Zone Scripting Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON