CVE-2021-42013
Path Traversal and Remote Code Execution in Apache HTTP Server 2.4.49 and 2.4.50 (incomplete fix of CVE-2021-41773)
In short
Apache HTTP Server versions 2.4.49 and 2.4.50 have an incomplete security fix that allows attackers to access files outside intended directories using specially crafted URLs. If those files are executable scripts, attackers can run arbitrary code on the server.
Technical detail
A path traversal vulnerability exists in the alias directive handling of Apache 2.4.49/2.4.50, where an incomplete patch for CVE-2021-41773 fails to properly restrict URL-to-file mapping. An unauthenticated remote attacker can craft requests to bypass directory restrictions and access protected resources, potentially achieving remote code execution if CGI is enabled on aliased paths and default protections are not in place.
Summary generated and translated by AI from the official 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.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Affected products
Apache Software Foundation · Apache HTTP Serverpublic PoCs found — 39
githubgithub.com/walnutsecurity/cve-2021-42013★ 26githubgithub.com/Vulnmachines/cve-2021-42013★ 15githubgithub.com/asaotomo/CVE-2021-42013-Apache-RCE-Poc-Exp★ 10githubgithub.com/andrea-mattioli/apache-exploit-CVE-2021-42013★ 9githubgithub.com/TheLastVvV/CVE-2021-42013_Reverse-Shell★ 7githubgithub.com/K3ysTr0K3R/CVE-2021-42013-EXPLOIT★ 6githubgithub.com/BassoNicolas/CVE-2021-42013★ 3githubgithub.com/TheLastVvV/CVE-2021-42013★ 2githubgithub.com/twseptian/cve-2021-42013-docker-lab★ 2githubgithub.com/bananoname/cve-2021-42013★ 1githubgithub.com/drackyjr/CVE-2021-42013★ 1githubgithub.com/robotsense1337/CVE-2021-42013★ 1githubgithub.com/jas9reet/CVE-2021-42013-LAB★ 1githubgithub.com/cybfar/cve-2021-42013-httpd★ 1githubgithub.com/vudala/CVE-2021-42013★ 1githubgithub.com/Hamesawian/CVE-2021-42013★ 1githubgithub.com/FakhriCRD/Apache-CVE-2021-42013-RCE-Exploit★ 0githubgithub.com/hadrian3689/apache_2.4.50★ 0githubgithub.com/viliuspovilaika/cve-2021-42013★ 0githubgithub.com/mightysai1997/cve-2021-42013★ 0githubgithub.com/mightysai1997/cve-2021-42013L★ 0githubgithub.com/mightysai1997/cve-2021-42013.get★ 0githubgithub.com/12345qwert123456/CVE-2021-42013★ 0githubgithub.com/Makavellik/POC-CVE-2021-42013-EXPLOIT★ 0githubgithub.com/dream434/cve-2021-42013-apache★ 0githubgithub.com/LayarKacaSiber/CVE-2021-42013★ 0githubgithub.com/zeynepglygt/apache-cve-2021-42013-rce★ 0githubgithub.com/asepsaepdin/CVE-2021-42013★ 0githubgithub.com/xMohamed0/CVE-2021-42013-ApacheRCE★ 0githubgithub.com/ranasen-rat/cve-2021-42013★ 0exploitdbwww.exploit-db.com/exploits/50512unverifiedcve_referencepacketstormsecurity.com/files/164609/Apache-HTTP-Server-2.4.50-Remote-Code-Execution.htmlunverifiedcve_referencepacketstormsecurity.com/files/164629/Apache-2.4.49-2.4.50-Traversal-Remote-Code-Execution.htmlunverifiedcve_referencepacketstormsecurity.com/files/164941/Apache-HTTP-Server-2.4.50-Remote-Code-Execution.htmlunverifiedcve_referencepacketstormsecurity.com/files/165089/Apache-HTTP-Server-2.4.50-CVE-2021-42013-Exploitation.htmlunverifiedcve_referencepacketstormsecurity.com/files/167397/Apache-2.4.50-Remote-Code-Execution.htmlunverifiedexploitdbwww.exploit-db.com/exploits/50406unverifiedexploitdbwww.exploit-db.com/exploits/50446unverifiedcve_referencepacketstormsecurity.com/files/164501/Apache-HTTP-Server-2.4.50-Path-Traversal-Code-Execution.htmlunverified⚠ Public resources, to assess the exposure of systems you control or are authorized to test. Test only with authorization.
Want to know if your infrastructure is exposed to this?
Talk to TrueHacking →References
http://jvn.jp/en/jp/JVN51106450/index.htmlhttp://packetstormsecurity.com/files/164501/Apache-HTTP-Server-2.4.50-Path-Traversal-Code-Execution.htmlhttp://packetstormsecurity.com/files/164609/Apache-HTTP-Server-2.4.50-Remote-Code-Execution.htmlhttp://packetstormsecurity.com/files/164629/Apache-2.4.49-2.4.50-Traversal-Remote-Code-Execution.htmlhttp://packetstormsecurity.com/files/164941/Apache-HTTP-Server-2.4.50-Remote-Code-Execution.htmlhttp://packetstormsecurity.com/files/165089/Apache-HTTP-Server-2.4.50-CVE-2021-42013-Exploitation.htmlhttp://packetstormsecurity.com/files/167397/Apache-2.4.50-Remote-Code-Execution.htmlhttps://httpd.apache.org/security/vulnerabilities_24.htmlhttps://lists.apache.org/thread.html/r17a4c6ce9aff662efd9459e9d1850ab4a611cb23392fc68264c72cb3%40%3Ccvs.httpd.apache.org%3Ehttps://lists.apache.org/thread.html/r7c795cd45a3384d4d27e57618a215b0ed19cb6ca8eb070061ad5d837%40%3Cannounce.apache.org%3Ehttps://lists.apache.org/thread.html/rb5b0e46f179f60b0c70204656bc52fcb558e961cb4d06a971e9e3efb%40%3Cusers.httpd.apache.org%3Ehttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RMIIEFINL6FUIOPD2A3M5XC6DH45Y3CC/