.. / CVE-2021-42013

Exploit for Apache 2.4.49/2.4.50 - Path Traversal and Remote Code Execution (CVE-2021-42013)

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.

Nuclei Template

View the template here CVE-2021-42013.yaml

Validate with Nuclei

echo "$URL" | nuclei -t ~/nuclei-templates/http/cves/2021/CVE-2021-42013.yaml
Copy

References:

https://httpd.apache.org/security/vulnerabilities_24.html
https://twitter.com/itsecurityco/status/1446136957117943815
https://github.com/apache/httpd/commit/5c385f2b6c8352e2ca0665e66af022d6e936db6d
https://nvd.nist.gov/vuln/detail/CVE-2021-42013
http://jvn.jp/en/jp/JVN51106450/index.html