1. Home
  2. Web App Vulnerabilities
  3. How to remediate – Apache Tomcat Manager Detected

How to remediate – Apache Tomcat Manager Detected

1. Introduction

Apache Tomcat Manager has been detected on the target web application. This is a web management interface for Apache Tomcat servers, which can allow an attacker to gain access to administrative functionality if not secured properly. Successful exploitation could lead to complete server compromise. Confidentiality, integrity and availability may be impacted.

2. Technical Explanation

Apache Tomcat Manager provides a web-based interface for managing Tomcat instances. If left exposed without proper authentication or access controls, it can allow attackers to deploy applications, view server configuration, and potentially execute arbitrary code. An attacker could exploit this by attempting to brute-force credentials or leveraging path normalization vulnerabilities as described in the BlackHat paper referenced below.

  • Root cause: The Tomcat Manager web application is accessible without sufficient authentication or access restrictions.
  • Exploit mechanism: An attacker attempts to access the manager interface, potentially using a brute-force attack against default credentials or exploiting path normalization flaws to bypass security checks.
  • Scope: Apache Tomcat versions with the Manager web application enabled are affected.

3. Detection and Assessment

  • Quick checks: Access the Tomcat Manager interface via a web browser (typically at http://{target_host}:8080/manager or similar). If accessible without authentication, it is likely vulnerable.
  • Scanning: Nessus plugin ID 13927 can detect exposed Tomcat Manager interfaces. This is an example only and may require updates.
  • Logs and evidence: Check web server logs for requests to the manager interface (e.g., /manager, /host-manager).
curl -I http://{target_host}:8080/manager

4. Solution / Remeditation Steps

Provide precise, ordered steps to fix the issue. Make steps small, testable, and safe to roll back. Only include steps that apply to this vulnerability.

4.1 Preparation

  • Stopping Tomcat is not usually required for these changes but consider it if you are unsure.
  • Roll back plan: Restore from snapshot or backup if issues occur.

4.2 Implementation

  1. Step 1: Restrict access to the manager interface using a .htaccess file in the Tomcat webapp directory (e.g., /var/lib/tomcat9/webapps/manager).
  2. Step 2: Configure the .htaccess file to allow access only from known IP addresses.

4.3 Config or Code Example

Before

# No .htaccess file exists, manager interface is publicly accessible.

After

<Files match="manager.html">
  Require ip 192.168.1.0/24
  Require ip 10.0.0.10
</Files>

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 to reduce the impact if exploited by limiting access to only authorized users and systems.
  • Practice 2: Secure configuration to prevent unnecessary exposure of management interfaces.

4.5 Automation (Optional)

# Example Ansible task to create .htaccess file:
- name: Restrict access to Tomcat Manager
  copy:
    dest: /var/lib/tomcat9/webapps/manager/.htaccess
    content: |
      <Files match="manager.html">
        Require ip 192.168.1.0/24
        Require ip 10.0.0.10
      </Files>
  notify: Restart Tomcat

5. Verification / Validation

Explain how to confirm the fix worked. Provide commands, expected outputs, and a short negative test if possible. Include a simple service smoke test.

  • Post-fix check: Attempt to access the Tomcat Manager interface from an unauthorized IP address. Access should be denied (HTTP 403 Forbidden).
  • Re-test: Re-run the quick check in section 3. The manager interface should no longer be accessible without authentication or from authorized IPs only.
  • Smoke test: Verify that legitimate users can still access other Tomcat applications and services.
  • Monitoring: Check web server logs for failed access attempts to the manager interface from unauthorized IP addresses.
curl -I http://{target_host}:8080/manager # Should return 403 Forbidden if restricted correctly

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 or policies to include restrictions on access to management interfaces.
  • Pipelines: Add checks in CI/CD pipelines to ensure secure configuration of Tomcat instances.
  • Asset and patch process: Implement a regular review cycle for Tomcat configurations to identify and address potential vulnerabilities.

7. Risks, Side Effects, and Roll Back

  • Risk or side effect 1: Incorrectly configured .htaccess file may block legitimate access to Tomcat applications.
  • Risk or side effect 2: Changes to web server configuration could impact other services if not carefully managed.
  • Roll back: Remove the .htaccess file from the Tomcat webapp directory and restart Tomcat.

8. References and Resources

Updated on October 26, 2025

Was this article helpful?

Related Articles