What is Apache HTTP Server?
Apache HTTP Server is one of the most widely deployed web servers in the world, powering a significant fraction of internet-accessible websites and internal applications. The 2.4.x branch is the current stable release series. Path traversal vulnerabilities in Apache allow attackers to read files outside the web server's configured document root — and when CGI is enabled, they can achieve remote code execution.
Overview
CVE-2021-42013 is a critical path traversal vulnerability (CWE-22) in Apache HTTP Server 2.4.49 and 2.4.50. The vulnerability is an incomplete fix for CVE-2021-41773 — the patch in Apache 2.4.50 failed to fully address the URL normalization bypass. An attacker can use additional URL encoding patterns (e.g., double-encoding or alternate percent-encoding sequences) to traverse outside the document root and read arbitrary files, or, if CGI scripts are enabled, execute arbitrary OS commands as the web server user. Apache 2.4.51 fully fixes both CVEs. Mass exploitation began the same day CVE-2021-42013 was disclosed.
Affected Versions
| Version | CVE-2021-41773 | CVE-2021-42013 | Action |
|---|---|---|---|
| Apache 2.4.48 and earlier | Not affected | Not affected | Upgrade anyway |
| Apache 2.4.49 | Vulnerable | Vulnerable | Upgrade immediately |
| Apache 2.4.50 | Fixed (incomplete) | Vulnerable | Upgrade immediately |
| Apache 2.4.51 | Fixed | Fixed | Safe |
Technical Details
Apache HTTP Server 2.4.49 introduced a change in URL normalization that created a path traversal bypass. The 2.4.50 fix addressed some encoding patterns but not all — specifically, additional URL encoding characters (e.g., %%32%65 or .%2e) could still bypass the normalization check:
- Root cause: Incomplete URL normalization in the path handling code — certain percent-encoded representations of
.and/characters were not properly decoded before path traversal checks - Exploit patterns:
GET /cgi-bin/.%2e/.%2e/.%2e/.%2e/etc/passwd HTTP/1.1or variations using double-encoding bypass the directory escape check - Path traversal: Allows reading any file the web server process has read access to (e.g.,
/etc/passwd, application configuration files, private keys) - RCE condition: Remote code execution requires
mod_cgiormod_cgidto be enabled AND the traversed path to reach a CGI-executable directory - Mass exploitation: Attackers scanned for vulnerable Apache 2.4.49/2.4.50 instances starting the day the CVE was published, deploying webshells and cryptominers
Discovery
Security researchers at Ash Daulton and others identified the incomplete fix in Apache 2.4.50 within days of that release. Apache responded with 2.4.51 on October 7 — the same day CVE-2021-42013 was published — demonstrating an exceptionally fast patch turnaround.
Exploitation Context
CVE-2021-42013 (and its predecessor CVE-2021-41773) saw immediate, widespread exploitation. Within 24 hours of public disclosure, internet-scale scanning for Apache 2.4.49 and 2.4.50 servers was underway, with exploitation including file read, webshell deployment, and cryptominer installation. Ransomware operators also incorporated this into their initial access toolkit, given the large number of vulnerable internet-facing Apache servers.
Remediation
- Upgrade to Apache HTTP Server 2.4.51 or later immediately — this fully fixes both CVE-2021-41773 and CVE-2021-42013
- Verify the Apache version in use:
apache2 -vorhttpd -v - If CGI is not required, disable
mod_cgiandmod_cgidto limit RCE impact even on older versions - Ensure
Require all deniedis set for directories not intended to be web-accessible — this limits path traversal impact - Review web server access logs for path traversal attempts (
/.%2e/,/%%32%65/,/../patterns) - Check for unexpected files written to the server's CGI directories or document root
Key Details
| Property | Value |
|---|---|
| CVE ID | CVE-2021-42013 |
| Vendor / Product | Apache — HTTP Server |
| NVD Published | 2021-10-07 |
| NVD Last Modified | 2025-10-27 |
| CVSS 3.1 Score | 9.8 |
| CVSS 3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Severity | CRITICAL |
| CWE | CWE-22 find similar ↗ |
| CISA KEV Added | 2021-11-03 |
| CISA KEV Deadline | 2021-11-17 |
| Known Ransomware Use | ⚠️ Yes |
CVSS 3.1 Breakdown
Required Action
Timeline
| Date | Event |
|---|---|
| 2021-10-04 | Apache HTTP Server 2.4.50 released to fix CVE-2021-41773 path traversal |
| 2021-10-07 | CVE-2021-42013 published — the 2.4.50 fix is found to be incomplete; Apache 2.4.51 released same day |
| 2021-10-07 | Mass exploitation of both CVE-2021-41773 and CVE-2021-42013 begins on internet-facing servers |
| 2021-11-03 | Added to CISA Known Exploited Vulnerabilities catalog |
| 2021-11-17 | CISA BOD 22-01 remediation deadline |
References
| Resource | Type |
|---|---|
| Apache HTTP Server 2.4 Vulnerabilities | Vendor Advisory |
| NVD — CVE-2021-42013 | Vulnerability Database |
| CISA KEV Catalog Entry | US Government |