CVE-2015-5345: Improper Limitation of a Pathname to a Restricted Directory in Apache Tomcat

org.apache.tomcat:tomcat Updated 02 Oct 2025

Summary

14/05/2022
Yes i
Moderate
5.3

CVE-2015-5345: Improper Limitation of a Pathname to a Restricted Directory in Apache Tomcat. Affects org.apache.tomcat:tomcat across 4 version ranges.

>= 6.0.0, < 6.0.45 >= 7.0.0, < 7.0.68 >= 8.0.0-RC1, < 8.0.30 >= 9.0.0.M1, < 9.0.0.M2

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Apache Tomcat is an open-source web server and servlet container that is used to deploy and run Java web applications. It provides a Java HTTP web server environment for running Java code. The vulnerability identified as CVE-2015-5345 affects versions 6.x, 7.x, 8.x, and 9.x of Apache Tomcat. This vulnerability allows remote attackers to determine the existence of a directory by exploiting a flaw in the Mapper component. The Mapper component processes redirects before considering security constraints and Filters, which can be exploited by attackers to identify the existence of a directory via a URL that lacks a trailing slash character.

Vulnerability Detail

The vulnerability arises from the improper limitation of a pathname to a restricted directory in Apache Tomcat. By exploiting this vulnerability, remote attackers can determine the existence of a directory by sending a specially crafted URL that lacks a trailing slash character. This can lead to information disclosure and potentially aid attackers in further exploiting the system. The vulnerability has a CVSS score of 5.3, indicating a moderate severity level.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 6.0.0, < 6.0.45 6.0.45
  • >= 7.0.0, < 7.0.68 7.0.68
  • >= 8.0.0-RC1, < 8.0.30 8.0.30
  • >= 9.0.0.M1, < 9.0.0.M2 9.0.0.M2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a workaround, users can manually add a trailing slash character to the URLs to prevent the disclosure of directory existence. This can be done by modifying the URLs in the application code or web server configuration. Here is an example of how to add a trailing slash to a URL in Java:

String url = "http://example.com/directory";
if (!url.endsWith("/")) {
    url += "/";
}

By ensuring that all URLs have a trailing slash, the vulnerability can be mitigated.

Conclusion

The vulnerability identified as CVE-2015-5345 in Apache Tomcat can be exploited by remote attackers to determine the existence of a directory. It is recommended to upgrade to the fixed versions of Apache Tomcat to mitigate this vulnerability. A workaround is available by manually adding a trailing slash to URLs. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.apache.tomcat:tomcat →

Share this vulnerability

FAQ

Apache Tomcat is an open-source web server and servlet container that is used to deploy and run Java web applications. It provides a Java HTTP web server environment for running Java code.

This vulnerability allows remote attackers to determine the existence of a directory by exploiting a flaw in the Mapper component of Apache Tomcat. This can lead to information disclosure and potentially aid attackers in further exploiting the system.

To fix this vulnerability, it is recommended to upgrade to the fixed versions of Apache Tomcat. For version 9.x, upgrade to version 9.0.0.M2 or later. For version 8.x, upgrade to version 8.0.30 or later. For version 7.x, upgrade to version 7.0.68 or later. For version 6.x, upgrade to version 6.0.45 or later.

Yes, a workaround is to manually add a trailing slash character to the URLs to prevent the disclosure of directory existence. This can be done by modifying the URLs in the application code or web server configuration.

The CVSS score of this vulnerability is 5.3, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for org.apache.tomcat:tomcat.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 6.0.0, < 6.0.45 6.0.45
  • >= 7.0.0, < 7.0.68 7.0.68
  • >= 8.0.0-RC1, < 8.0.30 8.0.30
  • >= 9.0.0.M1, < 9.0.0.M2 9.0.0.M2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback