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
B63-POC-CVE-2026-42945 — PoC and verification material for CVE-2026-42945 (CWE-122 heap overflow in ngx_http_rewrite_module -> attacker-shaped cleanup hijack -> system() RCE in the ASLR-off worker; patched-twin negative + 5/5 reliability captured in the shipped lab) | Kitploit
Tools/GitHubGitHub/basesixtythree/b63-poc-cve-2026-42945
Vulnerability AnalysisExploitationWeb Application ExploitationPapers & ResearchBinary ExploitationLabs & Practice
GitHubbasesixtythree/b63-poc-cve-2026-42945

B63-POC-CVE-2026-42945

PoC and verification material for CVE-2026-42945 (CWE-122 heap overflow in ngx_http_rewrite_module -> attacker-shaped cleanup hijack -> system() RCE in the ASLR-off worker; patched-twin negative + 5/5 reliability captured in the shipped lab)

View Repository
17 days agoNot yet reviewed
Share

B63-POC-CVE-2026-42945 -- NGINX Rift

Proof-of-concept and verification material for CVE-2026-42945 ("NGINX Rift" -- the community name from the DepthFirst disclosure): an unauthenticated heap buffer overflow (CWE-122) in nginx's ngx_http_rewrite_module, demonstrated in the lab through to system() command execution inside a worker.

The advisory facts, quoted:

CVSS 8.1 -- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H and the vendor's secondary CVSS 4.0 vector CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/ SC:N/SI:N/SA:N (base 9.2 CRITICAL, source: F5 SIRT via NVD metrics). CWE-122. "NGINX Plus and NGINX Open Source have a vulnerability in the ngx_http_rewrite_module module. This vulnerability exists when the rewrite directive is followed by a rewrite, if, or set directive and an unnamed Perl-Compatible Regular Expression (PCRE) capture (for example, $1, $2) with a replacement string that includes a question mark (?). An unauthenticated attacker ... may cause a heap buffer overflow in the NGINX worker process leading to a restart. Additionally, attackers can execute code on systems with ASLR disabled or when the attacker can bypass ASLR." (F5 security advisory K000161019; GHSA-gcgv-v5gf-c543)

Root cause (one line)

ngx_http_script_start_args_code() sets the script engine's is_args flag when a rewrite replacement contains ?, and nothing ever clears it. A later set $var $unnamed-capture then sizes the destination with a freshly zeroed sub-engine (raw capture length) but copies on the polluted main engine, where every escapable byte expands 3x under ngx_escape_uri's ARGS table (+ -> %2B). The write runs past the allocation by exactly 2 bytes per escapable byte, and the padding is attacker-chosen: a contiguous, attacker-shaped pool overflow.

Pinned-source verification: the args[] escape bitmap used internally was checked byte-identical against the pinned nginx src/core/ngx_string.c, and the one-line upstream fix (ngx_http_script_regex_end_code() gains e->is_args = 0; -- commit 2046b45a mainline / 524977e7c in 1.30.1) matches the behavior A/B below.

Exploitation chain (as verified)

  1. Spray (POST /spray, client_body_in_single_buffer on): wave 1 = filler bodies preconditioning the pool map; wave 2 = 20 x 4000-byte bodies starting with a fake ngx_pool_cleanup_s (handler = &system@libc, data = cmd slot, next = 0) followed by the command string. POST bodies are the only arbitrary-binary (NULs allowed) vector; header-borne bytes get escaped.
  2. Feng shui: connection A holds partial headers (its request pool allocates); victim V arrives next so V's pool lands right after A's.
  3. Overflow: A completes with GET /api/ + Ax349 + +x969 + a 6-byte target; the ? in the rewrite arms is_args; the set $var $1 copy runs the %2B-paint past A's block into V_pool.cleanup (+0x40), landing the 6-byte fake-struct address.
  4. Detonation: V closes -> ngx_destroy_pool() walks the (now attacker-controlled) cleanup chain FIRST -> c->handler(c->data) -> system("command") in the worker.

Success is always asserted by artifact readback (a nonce-keyed marker file containing RIFT-<nonce>-B3G1N plus a uid= line, read back inside the container) -- never by the attacker-side "connection crashed" inference. That difference is load-bearing here: the published reference PoC's "crashed => executed" heuristic fired with NO execution on this lab rebuild (no marker, no child process), and this repo's drivers and harnesses therefore never use it.

Verification tiers

Every transcript marked captured was re-captured from a fresh checkout of THIS tree (its own poc/ drivers and poc/ harnesses against lab/), so the files and word forms below are the shipped ones.

ClaimTierEvidence transcript
Positive RCE, opt driver (marker + uid=0(root) readback)capturedevidence/01-positive-opt-rce.txt
Positive RCE, readable drivercapturedevidence/02-positive-readable-rce.txt
Patched release-1.30.1 twin: sweep exhausts, exit 1, no marker, no artifactcapturedevidence/03-negative-patched-twin.txt
Master+worker (nobody) twin build: not captureddocumented, not reproduced here -- this rebuild's deterministic fake-struct family contains no URI-safe landing window (measured, see below); its non-fire receipt is evidence/04-open-twin-master-on.txtevidence/04-open-twin-master-on.txt
Reliability, opt driver: 5/5 fresh-instance legs, marker + uid=0 eachcapturedevidence/05-reliability-opt-5of5.txt
Reliability, readable driver: 5/5 fresh-instance legscapturedevidence/06-reliability-readable-5of5.txt
4-leg verification matrix: vuln CAPTURED / patched CLEAN / unaffected SKIPPED with reason / master-ON twin documented open legcapturedevidence/07-matrix-4legs.txt

The captured transcripts carry raw output only -- the recording wrapper is an internal harness, so these are the verbatim driver/harness stdout plus a one-line [b63] marker readback receipt from docker exec where the tier asserts the artifact. The clone used for re-capture is a neutral scratch checkout; output bodies are byte-untouched.

Scope statements (honest, not hidden)

  • ASLR-off scope, exactly as the disclosure demonstrated. The lab runs nginx under setarch -R (ADDR_NO_RANDOMIZE inherited), giving a per-BUILD deterministic layout. The positive legs live entirely in that scope. ASLR-on is NOT claimed: with ASLR on, the same corruption yields worker crash-loop behavior (the advisory's "leading to a restart"), not demonstrated RCE here.
  • Per-build constants. SYSTEM_ADDR and the landing-table are deterministic for THIS build+config and must be re-derived for any other build (the derivation kit ships: see below). A rebuild shifts the family; a marker-scan routine is provided rather than pretending the constants travel.
  • One aligned shot per instance. The chain's spray/feng-shui/readback cadence preconditions a per-instance deterministic heap state; extra fire attempts within one instance measurably LOWER the hit rate. Measured-in-run numbers: 7/8 at --tries 5 vs 15/15 at --tries 1 (internal session measurement; the shipped transcripts below are all --tries 1 per fresh instance -- the shipped capture backs the configured shape, not that internal count pair).
  • Reference-driver false positive. The core crash-inference finding (the published reference PoC reports "crashed => executed" while the marker file never appears and no child process exists) was reproduced during the internal run without its own public transcript; the shipped evidence instead demonstrates the readback contract that replaces it (every positive row ships marker + uid lines).
  • The uid=nobody master+worker twin. A production-shape twin (master process on, worker nobody) was built and attacked; on THIS rebuild its deterministic landing family contains no URI-safe window (measured during the internal run: sibling fake structs carry the unsafe bytes 0x84/0x8a/0xbb), so its fused leg is documented open, not captured (evidence/04 is the receipt of that non-fire). This is a config/layout artifact of this build, not a boundary of the bug class.

Files

poc/exploit_opt.c        tunable candidate sweep (one aligned shot)
poc/exploit_readable.c   heavily commented walkthrough build
poc/reliability.sh       5 fresh-instance legs per run, per-run verdict
poc/matrix.sh            4-leg verification matrix
lab/                     Dockerfile + compose + nginx config + backend,
                         plus the per-build constant derivation kit
evidence/                the tier-table transcripts

Build (C99, no external dependencies):

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.

    891
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

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

    369
  • 4

    redforge

    cybersecurity91/redforge

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

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

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

    282

Explore all tools

Browse our collection of tools

View all tools →