1. Home
  2. Web App Vulnerabilities
  3. How to remediate – Apache Tomcat Site Enumeration

How to remediate – Apache Tomcat Site Enumeration

1. Introduction

Apache Tomcat Site Enumeration refers to the retrieval of domain names and IP addresses from Apache Tomcat configuration files on a remote host. This information can be used by attackers for reconnaissance, potentially leading to targeted attacks against websites hosted on those servers. Systems running Apache Tomcat webserver environments are usually affected. A successful exploit could lead to information disclosure impacting confidentiality.

2. Technical Explanation

The vulnerability occurs because Apache Tomcat configuration files may contain domain names and IP addresses of hosted websites, making them accessible to attackers. An attacker can retrieve this information without authentication. There is no known CVE associated with this specific enumeration issue, but it represents a general risk related to information leakage. For example, an attacker could scan a network for running Tomcat instances and then enumerate the sites hosted on each server to identify potential targets. Affected versions are those where site configuration details are exposed in accessible files.

  • Root cause: Exposed domain names and IP addresses within Apache Tomcat configuration files.
  • Exploit mechanism: An attacker retrieves the contents of these files via HTTP or HTTPS requests.
  • Scope: Apache Tomcat webserver environments.

3. Detection and Assessment

To confirm vulnerability, check for accessible Tomcat configuration files containing site information. A thorough method involves reviewing the server’s file system for exposed configurations.

  • Quick checks: Check if the Tomcat manager application is accessible via a web browser (e.g., http://:8080/manager).
  • Scanning: Nessus plugin ID 16379 can identify exposed Tomcat configuration files as an example.
  • Logs and evidence: Examine Apache Tomcat access logs for requests to configuration file paths (e.g., conf/server.xml, webapps/ROOT/META-INF/context.xml).
curl http://:8080/manager/html  # Check if manager app is accessible

4. Solution / Remediation Steps

Fix the issue by restricting access to Tomcat configuration files and removing sensitive information where possible.

4.1 Preparation

  • Dependencies: Access to the server’s file system is required. Roll back plan: Restore the backed-up configuration files.
  • Change window needs: Standard maintenance window may be needed, depending on downtime tolerance.

4.2 Implementation

  1. Step 1: Restrict access to Tomcat configuration directories using web server firewall rules (e.g., Apache or Nginx).
  2. Step 2: Remove sensitive information like domain names and IP addresses from configuration files if they are not required for functionality.
  3. Step 3: Restart the Tomcat service to apply changes.

4.3 Config or Code Example

Before

<Host name="example.com" appBase="webapps">

After

<Host name="localhost" appBase="webapps"> # Replace with a non-public hostname

4.4 Security Practices Relevant to This Vulnerability

List only practices that directly address this vulnerability type. Use neutral wording and examples instead of fixed advice. For example: least privilege, input validation, safe defaults, secure headers, patch cadence. If a practice does not apply, do not include it.

  • Practice 1: Least privilege access to configuration files reduces the impact if an attacker gains access.
  • Practice 2: Regularly review and sanitize configuration files for sensitive data.

4.5 Automation (Optional)

# Example Bash script to restrict access using iptables (use with caution)
#!/bin/bash
iptables -A INPUT -p tcp --dport 8080 -j DROP # Block external access to Tomcat port

5. Verification / Validation

Confirm the fix by attempting to retrieve configuration files and verifying that access is denied. Provide commands, expected outputs, and a short negative test if possible. Include a simple service smoke test.

  • Post-fix check: Attempt to access http://:8080/manager/html; expect a “403 Forbidden” error or similar access denied message.
  • Re-test: Re-run the curl command from Step 3 of Detection and Assessment, verifying that configuration files are no longer accessible.
  • Smoke test: Verify that websites hosted on Tomcat remain accessible via their public URLs.
  • Monitoring: Monitor Apache Tomcat access logs for failed requests to configuration file paths as an example.
curl http://:8080/manager/html # Expect 403 Forbidden

6. Preventive Measures and Monitoring

Suggest only measures that are relevant to the vulnerability type. Use “for example” to keep advice conditional, not prescriptive.

  • Baselines: Update security baselines to include restrictions on access to Tomcat configuration files.
  • Asset and patch process: Maintain a regular review cycle for Apache Tomcat configurations, including removing unnecessary information.

7. Risks, Side Effects, and Roll Back

  • Risk or side effect 2: Removing essential configuration data can cause websites to malfunction; back up files first.
  • Roll back: Restore the backed-up Apache Tomcat configuration directory and restart the service.

8. References and Resources

Updated on October 26, 2025

Was this article helpful?

Related Articles