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-lab — Educational FastAPI lab demonstrating CVE-2021-41773 directory traversal and local file inclusion, with a vulnerable server, patched code, and encoded payload examples for local security training. | Kitploit
Tools/GitHubGitHub/kunalkhandelwal-dev/cve-2021-41773-lab
Vulnerability AnalysisWeb Application ExploitationWeb SecurityLearning & EducationLabs & Practice
GitHubkunalkhandelwal-dev/cve-2021-41773-lab

cve-2021-41773-lab

Educational FastAPI lab demonstrating CVE-2021-41773 directory traversal and local file inclusion, with a vulnerable server, patched code, and encoded payload examples for local security training.

View Repository
403 months agoNot yet reviewed
Share

CVE-2021-41773 — Minimal FastAPI Lab

A small, self-contained FastAPI lab demonstrating how decoding user input before validating filesystem boundaries can lead to directory traversal and local file inclusion (LFI), modeled after the Apache HTTP Server issues CVE-2021-41773.


Features

  • Minimal, easy-to-read FastAPI examples: a vulnerable server and a patched server
  • Demonstrates single-encoded (%2e) and double-encoded (%252e) bypasses
  • Root endpoint includes quick payloads for testing with curl
  • No Docker required — runs locally with uvicorn

Repository Layout

  • patched_app.py — secured implementation (uses canonical path checks)
  • vulnerable_app.py — intentionally vulnerable implementation
  • secret.txt — out-of-bounds secret file used as exploit target
  • webroot/test.txt — public file served by the example
  • README.md — this file

Requirements

  • Python 3.8+
  • pip

Install runtime dependencies:

pip install fastapi uvicorn

Quickstart

  1. Create and activate a virtual environment (Windows PowerShell example):
python -m venv venv
.\venv\Scripts\activate
  1. Install dependencies:
pip install fastapi uvicorn
  1. Run the vulnerable server (port 8011):
uvicorn vulnerable_app:app --port 8011

Open http://127.0.0.1:8011/ in your browser — the root endpoint shows common payloads and notes.

To observe the fix, stop the vulnerable server and run the patched server:

uvicorn patched_app:app --port 8011

Example Requests (curl)

  • Baseline access to a public file:
curl --path-as-is http://localhost:8011/icons/test.txt
  • CVE-2021-41773 (single encoding) — bypasses naive boundary checks:
curl --path-as-is "http://localhost:8011/icons/.%2e/secret.txt"
  • CVE-2021-42013 (double encoding) — bypasses filters that don't decode repeatedly:
curl --path-as-is "http://localhost:8011/icons/.%252e/secret.txt"

Against the vulnerable server these payloads may return secret.txt. Against the patched server they should be rejected (HTTP 403).


How the Patch Works (high level)

  1. Fully decode the incoming path (handle multiple encoding layers).
  2. Resolve the canonical filesystem path with os.path.realpath().
  3. Enforce that the resolved path is inside the intended webroot directory — deny otherwise.

This enforces correct ordering: decode → canonicalize → authorize.


Safety & Usage

This repository is for local, educational use only. Do not expose the vulnerable server to public networks.


License

MIT License


Author

Kunal Khandelwal — Security Researcher, Application Security

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.

    795
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    520
  • 3

    ARTEX

    baarai/artex

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

    439
  • 4

    redforge

    cybersecurity91/redforge

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

    346
  • 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.

    267
  • 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.

    264

Explore all tools

Browse our collection of tools

View all tools →