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)

Basic Information

CVE State
PUBLISHED
Reserved Date
October 06, 2021
Published Date
October 07, 2021
Last Updated
February 04, 2025
Vendor
Apache Software Foundation
Product
Apache HTTP Server
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 Scores

SSVC Information

Exploitation
active
Automatable
Yes
Technical Impact
total

Exploit Status

Exploited in the Wild
Yes (added 2021-11-03 00:00:00 UTC) Source
Proof of Concept Available
Yes (added 2021-11-03 17:33:52 UTC) Source
Used in Malware
Yes (added 2021-11-03 00:00:00 UTC) Source

References

https://httpd.apache.org/security/vulnerabilities_24.html 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 http://www.openwall.com/lists/oss-security/2021/10/07/6 https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-httpd-pathtrv-LAzg68cZ http://jvn.jp/en/jp/JVN51106450/index.html http://www.openwall.com/lists/oss-security/2021/10/08/1 https://lists.apache.org/thread.html/r17a4c6ce9aff662efd9459e9d1850ab4a611cb23392fc68264c72cb3%40%3Ccvs.httpd.apache.org%3E 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/6 http://www.openwall.com/lists/oss-security/2021/10/08/5 http://www.openwall.com/lists/oss-security/2021/10/09/1 http://www.openwall.com/lists/oss-security/2021/10/11/4 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/ http://www.openwall.com/lists/oss-security/2021/10/15/3 http://www.openwall.com/lists/oss-security/2021/10/16/1 https://www.oracle.com/security-alerts/cpujan2022.html https://security.netapp.com/advisory/ntap-20211029-0009/ 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/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/165089/Apache-HTTP-Server-2.4.50-CVE-2021-42013-Exploitation.html https://www.oracle.com/security-alerts/cpuapr2022.html http://packetstormsecurity.com/files/167397/Apache-2.4.50-Remote-Code-Execution.html https://www.povilaika.com/apache-2-4-50-exploit/ https://security.gentoo.org/glsa/202208-20

Known Exploited Vulnerability Information

Source Added Date
CISA 2021-11-03 00:00:00 UTC

Potential Proof of Concepts

Warning: These PoCs have not been tested and could contain malware. Use at your own risk.

apache_normalize_path_rce

Type: metasploit • Created: Unknown

Metasploit module for CVE-2021-42013

BassoNicolas/CVE-2021-42013

Type: github • Created: 2024-04-07 16:04:06 UTC • Stars: 3

CVE-2021-42013 Vulnerability Scanner This Python script checks for the Remote Code Execution (RCE) vulnerability (CVE-2021-42013) in Apache 2.4.50.

K3ysTr0K3R/CVE-2021-42013-EXPLOIT

Type: github • Created: 2023-08-25 19:51:01 UTC • Stars: 2

A PoC exploit for CVE-2021-42013 - Apache 2.4.49 & 2.4.50 Remote Code Execution

asaotomo/CVE-2021-42013-Apache-RCE-Poc-Exp

Type: github • Created: 2021-12-23 14:46:41 UTC • Stars: 10

Apache 远程代码执行 (CVE-2021-42013)批量检测工具:Apache HTTP Server是美国阿帕奇(Apache)基金会的一款开源网页服务器。该服务器具有快速、可靠且可通过简单的API进行扩充的特点,发现 Apache HTTP Server 2.4.50 中针对 CVE-2021-41773 的修复不够充分。攻击者可以使用路径遍历攻击将 URL 映射到由类似别名的指令配置的目录之外的文件。如果这些目录之外的文件不受通常的默认配置“要求全部拒绝”的保护,则这些请求可能会成功。如果还为这些别名路径启用了 CGI 脚本,则这可能允许远程代码执行。此问题仅影响 Apache 2.4.49 和 Apache 2.4.50,而不影响更早版本。

robotsense1337/CVE-2021-42013

Type: github • Created: 2021-11-03 17:33:52 UTC • Stars: 1

Exploit Apache 2.4.50(CVE-2021-42013)

TheLastVvV/CVE-2021-42013_Reverse-Shell

Type: github • Created: 2021-10-24 12:57:55 UTC • Stars: 7

PoC CVE-2021-42013 reverse shell Apache 2.4.50 with CGI

TheLastVvV/CVE-2021-42013

Type: github • Created: 2021-10-23 21:58:44 UTC • Stars: 2

Poc CVE-2021-42013 - Apache 2.4.50 without CGI

andrea-mattioli/apache-exploit-CVE-2021-42013

Type: github • Created: 2021-10-07 18:31:29 UTC • Stars: 9

Exploit with integrated shodan search