{"id":"CVE-2025-31651","published":"2025-04-28T19:17:21Z","modified":"2026-02-26T18:27:59Z","title":"Apache Tomcat: Bypass of rules in Rewrite Valve","vendor":"Apache","product":"Apache Tomcat","tier":"tail","description":{"text":"Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in Apache Tomcat. For a subset of unlikely rewrite rule configurations, it was possible \nfor a specially crafted request to bypass some rewrite rules. If those \nrewrite rules effectively enforced security constraints, those \nconstraints could be bypassed.\n\nThis 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.\nThe following versions were EOL at the time the CVE was created but are \nknown to be affected: 8.5.0 though 8.5.100. Other, older, EOL versions \nmay also be affected.\n\n\nUsers are recommended to upgrade to version [FIXED_VERSION], which fixes the issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.04263,"percentile":0.91063,"provenance":"source"},"cwes":[{"id":"CWE-116","name":"Improper Encoding or Escaping of Output"}],"references":[{"url":"https://lists.apache.org/list.html?announce@tomcat.apache.org","tags":["vendor-advisory"]},{"url":"http://www.openwall.com/lists/oss-security/2025/04/28/3","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2025/07/msg00009.html","tags":[]}],"priority":{"score":30.1,"factors":[{"name":"EPSS percentile","points":18.21},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":6.86}]},"exploitSources":{"pocGithub":{"count":1,"skipped":1,"earliest":"2025-04-08","earliestUrl":"https://github.com/gregk4sec/CVE-2025-31651-o","repos":[{"name":"gregk4sec/CVE-2025-31651-o","url":"https://github.com/gregk4sec/CVE-2025-31651-o","stars":2,"created":"2025-04-08"}]},"first":{"date":"2025-04-08","source":"PoC-in-GitHub","url":"https://github.com/gregk4sec/CVE-2025-31651-o"},"provenance":"source"},"vendorSlug":"apache","affectedVersions":[{"vendor":"Apache Software Foundation","product":"Apache Tomcat","versions":[">= 11.0.0-M1, <= 11.0.5",">= 10.1.0-M1, <= 10.1.39",">= 9.0.0.M1, <= 9.0.102",">= 8.5.0, <= 8.5.100"]}],"affected":[{"ecosystem":"Maven","package":"org.apache.tomcat:tomcat-catalina","vulnerableRanges":[">=9.0.76, <9.0.104",">=10.1.10, <10.1.40",">=11.0.0-M2, <11.0.6",">=8.5.0, <=8.5.100"],"patched":["9.0.104","10.1.40","11.0.6"],"from":["GHSA-ff77-26x5-69cr"],"provenance":"source"},{"ecosystem":"Maven","package":"org.apache.tomcat.embed:tomcat-embed-core","vulnerableRanges":[">=9.0.76, <9.0.104",">=10.1.10, <10.1.40",">=11.0.0-M2, <11.0.6",">=8.5.0, <=8.5.100"],"patched":["9.0.104","10.1.40","11.0.6"],"from":["GHSA-ff77-26x5-69cr"],"provenance":"source"}],"euvd":{"id":"EUVD-2025-13626","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-apache-tomcat-cve-2008-2938","parents":[{"from":"CVE-2008-2938","to":"CVE-2025-31651","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["java/org/apache/catalina/connector/CoyoteAdapter.java"],"commits":["https://github.com/apache/tomcat/commit/c55ad56ed72ee1dbfe790bc5492d4df74e3e754f","https://github.com/apache/tomcat/commit/066bf6b6a15a4e7e0941d4acf096841165b97098","https://github.com/apache/tomcat/commit/175dc75fc428930034a6c93fb52f830d955d8e64"],"basis":"shared function","functions":["postParseRequest"]}]},{"from":"CVE-2015-5346","to":"CVE-2025-31651","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["java/org/apache/catalina/connector/CoyoteAdapter.java"],"commits":["https://github.com/apache/tomcat/commit/04164c1f01b973e548d95511d417f414ca723cb8","https://github.com/apache/tomcat/commit/6287be37d8d06c320215c45f7e2b8380411692e0","https://github.com/apache/tomcat/commit/066bf6b6a15a4e7e0941d4acf096841165b97098","https://github.com/apache/tomcat/commit/175dc75fc428930034a6c93fb52f830d955d8e64"],"basis":"shared function","functions":["postParseRequest"]}]}],"children":[{"from":"CVE-2025-31651","to":"CVE-2025-55752","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["java/org/apache/catalina/valves/rewrite/RewriteValve.java"],"commits":["https://github.com/apache/tomcat/commit/066bf6b6a15a4e7e0941d4acf096841165b97098","https://github.com/apache/tomcat/commit/175dc75fc428930034a6c93fb52f830d955d8e64","https://github.com/apache/tomcat/commit/130d36d8492ef9e4eb22952c17c92423cb35fd06","https://github.com/apache/tomcat/commit/b5042622b8b78340ae65403c55dcb9c7416924df"],"basis":"shared function","functions":["invoke"]}]}],"packageHistory":[{"cve":"CVE-2024-56337","published":"2024-12-20","fixed":"11.0.2","kev":false},{"cve":"CVE-2025-24813","published":"2025-03-10","fixed":"11.0.3","kev":true,"link":{"from":"CVE-2025-24813","to":"CVE-2025-31651","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.apache.tomcat.embed:tomcat-embed-core","fromFixed":"9.0.99","toFixed":"9.0.104","daysApart":49},{"kind":"version-step","provenance":"source","package":"Maven:org.apache.tomcat.embed:tomcat-embed-core","fromFixed":"10.1.35","toFixed":"10.1.40","daysApart":49}]}},{"cve":"CVE-2025-31650","published":"2025-04-28","fixed":"11.0.6","kev":false},{"cve":"CVE-2025-31651","published":"2025-04-28","fixed":"11.0.6","kev":false},{"cve":"CVE-2025-46701","published":"2025-05-29","fixed":"11.0.7","kev":false,"link":{"from":"CVE-2025-31651","to":"CVE-2025-46701","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.apache.tomcat:tomcat-catalina","fromFixed":"10.1.40","toFixed":"10.1.41","daysApart":31},{"kind":"version-step","provenance":"source","package":"Maven:org.apache.tomcat:tomcat-catalina","fromFixed":"11.0.6","toFixed":"11.0.7","daysApart":31}]}},{"cve":"CVE-2025-48988","published":"2025-06-16","fixed":"11.0.8","kev":false},{"cve":"CVE-2025-49124","published":"2025-06-16","fixed":"11.0.8","kev":false}],"package":"Maven:org.apache.tomcat.embed:tomcat-embed-core"}}