Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/ivanesk315/cve-2026-42533
Vulnerability ScannersVulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityFuzzingPapers & ResearchLearning & EducationLabs & Practice
GitHubivanesk315/cve-2026-42533

CVE-2026-42533

Docker lab reproducing CVE-2026-42533, a pre-auth nginx heap overflow and info leak via two-pass capture clobbering, with PoC scripts and patched comparison.

0 days agoNot yet reviewed
View Repository

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-42533 Lab — NGINX Two-Pass Capture Clobbering RCE

CVSS 9.2 (Critical) — Pre-auth heap buffer overflow + info leak in nginx Affected: nginx 0.9.6 – 1.30.3 / 1.31.2 | Patched: 1.30.4 / 1.31.3

Architecture

root@kitploit:~
                    ┌─────────────────────────────────────┐
                    │           Host machine               │
                    │                                      │
  PoC scripts ──────┤  :8080 ──► nginx-vuln  (1.26.x)     │
                    │              │          VULNERABLE    │
                    │              ▼                        │
                    │           backend (Python echo)       │
                    │              ▲                        │
                    │              │                        │
                    │  :8081 ──► nginx-patched (1.30.4)     │
                    │                          SAFE         │
                    └─────────────────────────────────────┘

Quick Start

root@kitploit:~
# Build and start
docker compose up --build -d

# Verify
curl http://localhost:8080/health
curl http://localhost:8081/health

# Run PoC
python3 poc_overflow.py          # Heap overflow (crash worker)
python3 poc_infoleak.py          # Info leak (heap residue)
bash poc_curl.sh                 # Quick curl-based tests

# Compare with patched
python3 poc_overflow.py localhost 8081
python3 poc_infoleak.py localhost 8081

# Check for crashes
docker logs nginx-vuln 2>&1 | grep -iE 'signal|segfault|abort'

# Cleanup
docker compose down

Vulnerability Mechanism

Root Cause

nginx evaluates directive values (proxy_set_header, return, add_header, etc.) in two passes using a shared mutable array r->captures:

PassPurposeReads r->captures
LENMeasure buffer size neededYes — to get $1 length
(regex map evaluates here, CLOBBERING r->captures)
VALUEWrite data into allocated bufferYes — but now $1 points elsewhere

Vulnerable Config Pattern

root@kitploit:~
map $http_user_agent $is_bot {
    ~*(bot|crawl|spider)  1;         # ← regex map = clobber trigger
    default               0;
}

location ~ "^/api/v1/(.+)$" {       # ← regex capture source
    proxy_set_header X-Route "$1 — $is_bot";   # ← two-pass sink
    #                         ^^    ^^^^^^^
    #                  capture ref + map var in same buffer = BUG
}

Attack Directions

DirectionURI sizeMap input sizeResult
OverflowShort (3 B)Long (4096 B)LEN allocates small, VALUE writes large → heap overflow
Info LeakLong (8000 B)Short (5 B)LEN allocates large, VALUE writes small → heap residue in response

Lab Scenarios

EndpointSinkMap TriggerDemo
/api/v1/{path}proxy_set_header$is_bot (User-Agent)Overflow
/leak/{path}return + add_header$ref_domain (Referer)Info leak
/rce/{path}set + return$is_bot (User-Agent)Overflow
/safe/{path}return (no map)NoneControl (safe)

Files

FilePurpose
docker-compose.ymlLab orchestration
Dockerfile.nginx-vulnVulnerable nginx 1.26.x
Dockerfile.nginx-patchedPatched nginx 1.30.4
nginx-vuln.confVulnerable configuration with annotated patterns
backend.pyEcho server to inspect proxied headers
poc_overflow.pyHeap overflow PoC (escalating payload sizes)
poc_infoleak.pyInfo leak PoC (heap residue detection)
poc_curl.shQuick curl-based tests

Detection

Use the config scanner:

root@kitploit:~
python3 nginx_capture_clobber_scan.py /etc/nginx/nginx.conf

Mitigation (without patching)

  1. Separate regex captures and regex map variables into different directives/locations
  2. Use named captures and reference them only inside the block holding the regex match
  3. Avoid ~ / ~* regex patterns in map when captures are used elsewhere

References

  • Researcher writeup (cyberstan.co.uk)
  • NVD entry
  • Config scanner
  • nginx advisory

FOR EDUCATIONAL AND AUTHORIZED SECURITY TESTING ONLY.

Download Tool