CVE DatabaseCVE-2021-42013
한국어 권고문 →
CVE-2021-420139.8/CRITICALCISA KEVCWE-22CWE-22

Apache HTTP Server Path Traversal and Remote Code Execution (RCE) Vulnerability Advisory (CVE-2021-42013)

⚡ Jump to Patch
Affected Vendors
apache
Affected Components
http_server
Published Date
2021-10-07
CVSS v3.1
9.8
CRITICAL
EPSS (30d)
100.0%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

Apache HTTP Server versions 2.4.49 and 2.4.50

Impact

Unauthenticated remote attackers can exploit this vulnerability to access sensitive files outside the document root or execute arbitrary commands if CGI scripts are enabled

Mitigation

Immediately upgrade Apache HTTP Server to version 2.4.51 or later, and enforce strict directory access controls

Affected Products & Version Scope

Apache HTTP Server versions 2.4.49 and 2.4.50 only (earlier versions are not affected)

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

The recommended remediation is to upgrade Apache HTTP Server to version 2.4.51 or later immediately.

bash
# For Debian/Ubuntu-based systems
sudo apt-get update
sudo apt-get install --only-upgrade apache2 -y

# For RedHat/CentOS-based systems
sudo yum update httpd -y

2. Temporary Workaround & Hardening Configuration

If an immediate upgrade is not feasible, modify the Apache configuration file (httpd.conf or apache2.conf) to explicitly deny access to the root directory.

nginx
# Open httpd.conf or apache2.conf and ensure the default directory block is secure
<Directory />
    AllowOverride none
    Require all denied
</Directory>

# Restart the Apache service to apply changes
sudo systemctl restart apache2  # Debian/Ubuntu
sudo systemctl restart httpd    # RHEL/CentOS

3. Log Audit & IoC Verification Commands

Use the following commands to inspect web server access logs for double-encoding traversal attempts and verify the running Apache version.

bash
# Search access logs for double-encoded traversal patterns and CGI execution attempts
grep -E '%%32%65|%2e%2e|cgi-bin' /var/log/apache2/access.log /var/log/httpd/access_log 2>/dev/null

# Check the current installed version of Apache HTTP Server
apache2 -v 2>/dev/null || httpd -v
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
Cloudflare Enterprise & Pro WAF
Organizations running Apache HTTP Server 2.4.49 or 2.4.50 must upgrade to 2.4.51 or higher immediately and verify that 'Require all denied' is enforced globally.

Block Exploits Instantly with Managed Virtual Patching Rules

Can't patch production immediately? Deploy managed WAF rules at the edge to intercept RCE, SQLi, and deserialization payloads before they hit your origin server.

3-min setup · Automated Zero-Day Managed Rules
Practice Exploiting & Patching This Web Vulnerability in an Interactive Lab
Launch Hands-On Security Lab

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This vulnerability (CVE-2021-42013) is a bypass of the initial fix introduced for CVE-2021-41773 in Apache HTTP Server 2.4.50. The root cause lies in an insufficient normalization logic of URL paths. While the server attempts to filter out standard dot-dot-slash ('..') sequences, it fails to properly handle double URL-encoded representations. Attackers can craft requests using double-encoded characters such as '%2e%2e%2f' or '%%32%65%%32%65%%33%66' to bypass the path traversal protection mechanism, allowing them to map URLs to files outside the configured document root.

2. Exploitation Mechanics & Attack Scenario

The exploitation relies on the presence of Alias-like directives (e.g., Alias, ScriptAlias) that map URLs to specific file system directories.

  • Path Traversal: An attacker sends a crafted HTTP request containing double-encoded traversal sequences (e.g., 'http://target/icons/%%32%65%%32%65/%%32%65%%32%65/etc/passwd'). If the target directories outside the alias are not protected by the default 'require all denied' configuration, the server returns the contents of the requested system files.
  • Remote Code Execution (RCE): If the mod_cgi module is enabled and the traversed path points to an executable binary (such as '/bin/sh'), the attacker can send a POST request containing shell commands in the request body, resulting in arbitrary command execution under the privileges of the Apache daemon process.

3. Infrastructure & Business Impact

With a CVSS score of 9.8 (Critical) and active exploitation observed in the wild (CISA KEV), this vulnerability poses an extreme risk to enterprise infrastructure. Successful exploitation allows unauthenticated remote code execution, which can lead to full system compromise, lateral movement within the internal network, data exfiltration, and deployment of ransomware or web shells.

Official Vendor Advisories & References

NVD Original English 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.

Frequently Asked SecOps Questions (CVE-2021-42013)

FAQ

Q1. How critical is CVE-2021-42013 and is it actively exploited in the wild?

CVE-2021-42013 is rated CVSS 9.8 (CRITICAL) with a 30-day EPSS exploitation probability of 100.0%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2021-42013?

Primary impacted vendors include apache across http_server. Scope summary: Apache HTTP Server versions 2.4.49 and 2.4.50 only (earlier versions are not affected)

Q3. What temporary mitigations or workarounds exist for CVE-2021-42013 before patching?

[Mitigation] Immediately upgrade Apache HTTP Server to version 2.4.51 or later, and enforce strict directory access controls Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2021-42013

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (apache)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2021-42013 Apache HTTP Server Path Traversal and Remote Code Execution (RCE) Vulnerability Advisory (CVE-2021-42013) (CVSS 9.8) - Patch & Workaround | CVE Pulse