CVE-2021-42013
CVE-2021-42013 is a critical-severity vulnerability in Apache Http Server with a CVSS 3.x base score of 9.8. It is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, confirming it has been exploited in the wild (added 2021-11-03). The underlying weakness is classified as CWE-22.
Key facts
- Severity: Critical (CVSS 3.x base score 9.8)
- CVSS v2: 7.5
- EPSS exploit prediction: 100% (100th percentile)
- Actively exploited: Yes — listed in CISA KEV (added 2021-11-03)
- EU (EUVD) id: EUVD-2021-29001
- EU exploitation: Flagged exploited in the ENISA EU Vulnerability Database (since 2021-11-03)
- Weakness: CWE-22
- Affected product: Apache Http Server
- Published:
- Last modified:
Description
It was found that the fix for CVE-2021-41773 in Apache HTTP Server 2.4.50 was insufficient. An attacker could use a path traversal attack to map URLs to files outside the directories configured by Alias-like directives. If files outside of these directories are not protected by the usual default configuration "require all denied", these requests can succeed. If CGI scripts are also enabled for these aliased pathes, this could allow for remote code execution. This issue only affects Apache 2.4.49 and Apache 2.4.50 and not earlier versions.
CVE-2021-42013: Apache HTTP Server Path Traversal and Remote Code Execution
AI-generated analysis based on the vulnerability data on this page.
| Attribute | Value |
|---|---|
| CVE ID | CVE-2021-42013 |
| CWE | CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') |
| CVSS v2 | 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P) |
| CVSS v3.1 | 9.8 CRITICAL (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| EPSS | 0.99964 (99.976th percentile) |
| Known Exploited (CISA KEV) | Yes — added 2021-11-03 |
| EU Exploited | Yes — since 2021-11-03 |
| Published | 2021-10-07 |
| Source | NVD |
Summary
The patch released for CVE-2021-41773 in Apache HTTP Server 2.4.50 was incomplete. Attackers can still perform path traversal using specially crafted URLs to access files outside directories configured by Alias-like directives. If CGI scripting is enabled for these aliased paths, the flaw can be leveraged for remote code execution. Only Apache 2.4.49 and 2.4.50 are affected; earlier versions are not.
Background
In September 2021, CVE-2021-41773 disclosed a path traversal vulnerability in Apache HTTP Server 2.4.49. The Apache team released 2.4.50 as a hotfix, but the validation logic did not fully cover encoded traversal sequences and edge cases in path resolution. Consequently, CVE-2021-42013 was assigned to the incomplete fix, prompting a second emergency patch in 2.4.51.
Root Cause
The vulnerability stems from CWE-22: Path Traversal. The URI normalization and path validation routines in server/util.c and related request-processing modules failed to reject all forms of ../ sequences—especially when combined with URL encoding or double encoding—after the initial fix. When mod_alias or mod_rewrite maps a URL prefix to a filesystem directory, the insufficient sanitization allows the remaining path segments to escape the intended document root or alias target.
Impact
With a CVSS v3.1 score of 9.8 (Critical), the vulnerability is network-exploitable with no authentication, no privileges, and no user interaction required. Successful exploitation can yield:
- Confidentiality impact: HIGH — arbitrary file read outside configured directories.
- Integrity impact: HIGH — arbitrary file write or modification if writable paths are reached.
- Availability impact: HIGH — remote code execution when CGI handlers are mapped to the traversed path.
The EPSS score of 0.99964 and inclusion in the CISA KEV catalog confirm this is one of the most reliably exploited web-server flaws in recent years.
Exploitation Walkthrough (Defensive Perspective)
Ethics caveat: The following description is provided for detection, hardening, and incident-response purposes only. Do not use this knowledge to attack systems without explicit authorization.
An attacker crafts an HTTP request containing encoded traversal sequences in the path, targeting an aliased URI prefix that maps to a local directory. If the server normalizes the path after prefix stripping (or fails to re-check boundary conditions post-normalization), the resulting filesystem path resolves above the alias root. Typical payloads abuse %2e%2e%2f, %2e%2e/, or multiple encoding layers.
When mod_cgi or mod_cgid is configured to execute scripts within the aliased path, the traversal can reach binary executables or writable script directories, turning file read into code execution.
Defensive takeaways:
- Treat any alias/CGI boundary as a high-risk trust boundary.
- Normalize and validate paths before prefix matching and again before filesystem access.
- Disable CGI execution in aliased paths unless strictly required.
Affected and Patched Versions
| Status | Versions |
|---|---|
| Affected | Apache HTTP Server 2.4.49, 2.4.50 |
| Not affected | Apache HTTP Server <= 2.4.48 |
| Patched | Apache HTTP Server >= 2.4.51 |
Third-party distributions (Fedora 34/35, select Oracle products, NetApp Cloud Backup) also shipped affected packages and issued their own updates.
Remediation
- Upgrade immediately to Apache HTTP Server 2.4.51 or later.
- Compensating controls (if patching is delayed):
- Add explicit
Require all denieddirectives outside intended alias roots. - Disable CGI execution (
Options -ExecCGI) on all aliased paths. - Deploy a Web Application Firewall (WAF) rule to block paths containing
..sequences, URL-encoded or literal. - Restrict ingress to the web server using network-level controls where possible.
- Add explicit
Detection
- Monitor access logs for
404or200responses to URI paths containing%2e,%2f, or double-encoded traversal sequences against aliased endpoints. - Correlate with process-spawn events from
mod_cgi/mod_cgidexecuting unexpected binaries. - Hunt for outbound connections or post-exploitation behavior from the
httpdworker processes. - Validate that vulnerability scanners and CMDB records flag Apache 2.4.49–2.4.50 as vulnerable.
Assessment
This CVE represents a textbook example of a patch-gap vulnerability: the initial fix addressed the most obvious attack vector but missed normalization subtleties, giving defenders a false sense of security while attackers continued to exploit the weakened perimeter. The near-perfect EPSS and confirmed active exploitation in the wild (CISA KEV, EU catalog) mean that any unpatched Apache 2.4.49/2.4.50 instance should be assumed compromised until proven otherwise.
Key lessons:
- Path normalization must be defense-in-depth, not a single regex or string replacement.
- Hotfix releases warrant accelerated regression testing and broader fuzzing, especially for traversal and injection classes.
References
- https://httpd.apache.org/security/vulnerabilities_24.html
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-42013
- https://security.gentoo.org/glsa/202208-20
- https://security.netapp.com/advisory/ntap-20211029-0009/
- https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-httpd-pathtrv-LAzg68cZ
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpujan2022.html
Frequently asked questions
- What is CVE-2021-42013?
- It was found that the fix for CVE-2021-41773 in Apache HTTP Server 2.4.50 was insufficient. An attacker could use a path traversal attack to map URLs to files outside the directories configured by Alias-like directives. If files outside of these directories are not protected by the usual default configuration "require all denied", these requests can succeed. If CGI scripts are also enabled for these aliased pathes, this could allow for remote code execution. This issue only affects Apache 2.4.49 and Apache 2.4.50 and not earlier versions.
- How severe is CVE-2021-42013?
- CVE-2021-42013 has a CVSS 3.x base score of 9.8, rated critical severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2021-42013 being actively exploited?
- Yes. CVE-2021-42013 is on CISA's Known Exploited Vulnerabilities (KEV) catalog, added on 2021-11-03, which means active exploitation has been confirmed. It should be prioritised for remediation.
- What products are affected by CVE-2021-42013?
- CVE-2021-42013 primarily affects Apache Http Server. In total, 10 product configurations (CPEs) are listed as vulnerable; see the affected-products list for the exact versions.
- How do I fix CVE-2021-42013?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Because this CVE is known to be actively exploited, treat remediation as urgent — CISA KEV typically sets a short remediation deadline.
- Does CVE-2021-42013 have an EU (EUVD) identifier?
- Yes. CVE-2021-42013 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2021-29001. It is also flagged as exploited in the EUVD (since 2021-11-03).
- When was CVE-2021-42013 published?
- CVE-2021-42013 was published on 2021-10-07 and last updated on 2026-06-17.
References
- http://jvn.jp/en/jp/JVN51106450/index.html
- http://packetstormsecurity.com/files/164501/Apache-HTTP-Server-2.4.50-Path-Traversal-Code-Execution.html
- http://packetstormsecurity.com/files/164609/Apache-HTTP-Server-2.4.50-Remote-Code-Execution.html
- http://packetstormsecurity.com/files/164629/Apache-2.4.49-2.4.50-Traversal-Remote-Code-Execution.html
- http://packetstormsecurity.com/files/164941/Apache-HTTP-Server-2.4.50-Remote-Code-Execution.html
- http://packetstormsecurity.com/files/165089/Apache-HTTP-Server-2.4.50-CVE-2021-42013-Exploitation.html
- http://packetstormsecurity.com/files/167397/Apache-2.4.50-Remote-Code-Execution.html
- http://www.openwall.com/lists/oss-security/2021/10/07/6
- http://www.openwall.com/lists/oss-security/2021/10/08/1
- http://www.openwall.com/lists/oss-security/2021/10/08/2
- http://www.openwall.com/lists/oss-security/2021/10/08/3
- http://www.openwall.com/lists/oss-security/2021/10/08/4
- http://www.openwall.com/lists/oss-security/2021/10/08/5
- http://www.openwall.com/lists/oss-security/2021/10/08/6
- http://www.openwall.com/lists/oss-security/2021/10/09/1
- http://www.openwall.com/lists/oss-security/2021/10/11/4
- http://www.openwall.com/lists/oss-security/2021/10/15/3
- http://www.openwall.com/lists/oss-security/2021/10/16/1
- https://httpd.apache.org/security/vulnerabilities_24.html
- https://lists.apache.org/thread.html/r17a4c6ce9aff662efd9459e9d1850ab4a611cb23392fc68264c72cb3%40%3Ccvs.httpd.apache.org%3E
- https://lists.apache.org/thread.html/r7c795cd45a3384d4d27e57618a215b0ed19cb6ca8eb070061ad5d837%40%3Cannounce.apache.org%3E
- https://lists.apache.org/thread.html/rb5b0e46f179f60b0c70204656bc52fcb558e961cb4d06a971e9e3efb%40%3Cusers.httpd.apache.org%3E
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RMIIEFINL6FUIOPD2A3M5XC6DH45Y3CC/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WS5RVHOIIRECG65ZBTZY7IEJVWQSQPG3/
- https://security.gentoo.org/glsa/202208-20
- https://security.netapp.com/advisory/ntap-20211029-0009/
- https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-httpd-pathtrv-LAzg68cZ
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://www.povilaika.com/apache-2-4-50-exploit/
Affected products (10)
- cpe:2.3:a:apache:http_server:2.4.49:*:*:*:*:*:*:*
- cpe:2.3:a:apache:http_server:2.4.50:*:*:*:*:*:*:*
- cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*
- cpe:2.3:a:oracle:instantis_enterprisetrack:17.1:*:*:*:*:*:*:*
- cpe:2.3:a:oracle:instantis_enterprisetrack:17.2:*:*:*:*:*:*:*
- cpe:2.3:a:oracle:instantis_enterprisetrack:17.3:*:*:*:*:*:*:*
- cpe:2.3:a:oracle:jd_edwards_enterpriseone_tools:*:*:*:*:*:*:*:*
- cpe:2.3:a:oracle:secure_backup:*:*:*:*:*:*:*:*
- cpe:2.3:a:netapp:cloud_backup:-:*:*:*:*:*:*:*
More vulnerabilities in Apache Http Server
- CVE-2010-0425 — Critical (CVSS 10.0): modules/arch/win32/mod_isapi.c in mod_isapi in the Apache HTTP Server 2.0.37 through 2.0.63, 2.2.0 through 2.2.14, and…
- CVE-2005-2700 — Critical (CVSS 10.0): ssl_engine_kernel.c in mod_ssl before 2.8.24, when using "SSLVerifyClient optional" in the global virtual host…
- CVE-2004-0492 — Critical (CVSS 10.0): Heap-based buffer overflow in proxy_util.c for mod_proxy in Apache 1.3.25 to 1.3.31 allows remote attackers to cause a…
- CVE-2003-0789 — Critical (CVSS 10.0): mod_cgid in Apache before 2.0.48, when using a threaded MPM, does not properly handle CGI redirect paths, which could…
- CVE-1999-1293 — Critical (CVSS 10.0): mod_proxy in Apache 1.2.5 and earlier allows remote attackers to cause a denial of service via malformed FTP commands,…
- CVE-1999-0926 — Critical (CVSS 10.0): Apache allows remote attackers to conduct a denial of service via a large number of MIME headers.
All CVEs affecting Apache Http Server →
Other CWE-22 (Path Traversal) vulnerabilities
- CVE-2026-48282 — Critical (CVSS 10.0): ColdFusion versions 2025.9, 2023.20 and earlier are affected by an Improper Limitation of a Pathname to a Restricted…
- CVE-2026-54917 — Critical (CVSS 10.0): SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables. Prior to 4.30, the…
- CVE-2026-11429 — Critical (CVSS 10.0): Two endpoints in the Vault Service ScriptsController, shared by Altium Enterprise Server and Altium 365, accept file…
- CVE-2026-34909 — Critical (CVSS 10.0): A malicious actor with access to the network could exploit a Path Traversal vulnerability found in UniFi OS devices to…
- CVE-2026-7411 — Critical (CVSS 10.0): In Eclipse BaSyx Java Server SDK versions prior to 2.0.0-milestone-10, inadequate path normalization in the Submodel…
- CVE-2026-36767 — Critical (CVSS 10.0): A path traversal vulnerability in the /content/images/add endpoint of shopizer v3.2.5 allows attackers write arbitrary…