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-2026-126937 — Differential PoC for CVE-2026-126937, a TOCTOU race in Zipline's POST /api/setup that creates multiple SUPERADMIN accounts; includes a Docker lab comparing 4.6.4 and 4.6.5. | Kitploit
Tools/GitHubGitHub/googlesky/cve-2026-126937
Privilege EscalationVulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingAuthenticationLabs & Practice
GitHubgooglesky/cve-2026-126937

CVE-2026-126937

Differential PoC for CVE-2026-126937, a TOCTOU race in Zipline's POST /api/setup that creates multiple SUPERADMIN accounts; includes a Docker lab comparing 4.6.4 and 4.6.5.

5 days agoNot yet reviewed
Share
View Repository

CVE-2026-126937 — Zipline Initial-Setup TOCTOU: Barrier-Synchronized /api/setup Creates 15 SUPERADMINs

License: MIT Research status: validated

CVECVE-2026-126937 (GHSA-wgjv-p9mm-qw77, High 8.1 CVSS v3.1)
ComponentZipline — src/server/routes/api/setup.ts (POST /api/setup)
Affected≤ 4.6.4
Fixed in4.6.5 (single transaction + pg_advisory_xact_lock)
CWECWE-367 (Time-of-Check Time-of-Use Race Condition)
ImpactOn a fresh installation whose web setup has not been completed, concurrent unauthenticated requests to POST /api/setup each create an independent SUPERADMIN account — full administrative control of the instance
VectorNetwork: barrier-synchronized POST /api/setup with distinct spoofed X-Forwarded-For headers (bypasses the per-IP limiter when CORE_TRUST_PROXY=true)
TriggerConcurrent POSTs during the argon2 hashing window (~100–500 ms)
CreditReported by EQSTLab; found by min8282; advisory published by diced (Zipline)

POST /api/setup reads the firstSetup flag through an unlocked prisma.zipline.findFirst(), hashes the admin password with argon2 — which suspends the async handler on the Node.js event loop for ~100–500 ms — creates the SUPERADMIN user, and only then resets the flag. There is no transaction, advisory lock, or unique constraint on role=SUPERADMIN. Every request that enters the handler during the hashing window observes firstSetup=true, passes the check, and independently creates its own SUPERADMIN. This lab races the official diced/zipline:4.6.4 image with 20 barrier-synchronized threads (unique spoofed X-Forwarded-For per thread against CORE_TRUST_PROXY=true) and measures the outcome: 15 of 20 requests created SUPERADMIN accounts inside a 323 ms window, three of which were proven to authenticate — while the fixed 4.6.5 image, raced the same way against the same database schema, created exactly one account and rejected the other 19 with error 9001 through the new advisory-lock transaction.

1. Root cause

The handler in src/server/routes/api/setup.ts (4.6.4) is three separate, non-atomic database operations:

const { firstSetup, id } = await getZipline();     // unlocked findFirst()
if (!firstSetup) throw new ApiError(9001);          // check
const { username, password } = req.body;
const user = await prisma.user.create({
  data: { username,
          password: await hashPassword(password),   // argon2: ~100–500 ms
          role: 'SUPERADMIN',
          token: createToken() },
  select: userSelect,
});                                                  // use
await prisma.zipline.update({ where: { id },
                              data: { firstSetup: false } });  // flag reset LAST

The violated invariant: the check, the user creation, and the flag reset must be one atomic unit. 4.6.5 wraps the whole sequence in prisma.$transaction protected by SELECT pg_advisory_xact_lock(hashtext('zipline:first_setup')), so the check and the flag reset are serialized: the first winner creates the account, every other concurrent request then observes firstSetup=false and receives error 9001.

The per-IP limiter (secondlyRatelimit(5) = 1 request per 5 s per IP) does not help a reverse-proxy deployment: with CORE_TRUST_PROXY=true (the default behind one) each request carrying a distinct X-Forwarded-For header is treated as a separate client with its own bucket.

2. Reproduction environment

serviceimagerole
postgrespostgres:16-alpinesite databases (zipline, zipline_fixed)
zipline-vulndiced/zipline:4.6.4vulnerable side, CORE_TRUST_PROXY=true
zipline-fixeddiced/zipline:4.6.5fixed side, same configuration, separate database
poc—stdlib Python driver (barrier-synchronized race)

All containers are CPU/memory bounded on the isolated cve126937lab network. Once setup completes, firstSetup stays false forever — the lab driver wipes the users and resets the row between measurements (run-lab.sh sweep).

3. Running the environment

./run-lab.sh build     # PoC runner image
./run-lab.sh sweep     # fresh window + check + exploit + DB differential
./run-lab.sh down

Single mode:

podman run --rm --network=cve126937lab cve-2026-126937-poc:local exploit

4. The PoC

poc/poc.py — stdlib-only Python, four modes:

modepurpose
checkclassify the target state: firstSetup=true on a fresh instance means the exploitable window is open (exit 1); completed setup means closed (exit 0)
exploitfull differential: 20 barrier-synchronized threads against both sides; asserts multiple SUPERADMINs on the vulnerable build, authenticates the created accounts via POST /api/auth/login, and asserts exactly one account on the fixed build
probestate observability (GET /api/setup) and the X-Forwarded-For acceptance that underlies the limiter bypass
mitigationthe fix is the 4.6.5 advisory lock — the exploit mode's fixed-side result is the mitigation evidence; there is no client-side workaround

Exit codes: 0 safe, 1 vulnerable, 2 target unreachable, 3 race not won this run (fresh window + retry), 4 internal error.

The race hit count is inherently probabilistic (event-loop scheduling); the state and the fix behavior are deterministic. The PoC reports the measured hit rate explicitly.

5. Expected results

reproduction pathvulnerable 4.6.4fixed 4.6.5evidence
GET /api/setup on a fresh instancefirstSetup=true (window open)firstSetup=trueevidence/poc-check.txt
20-thread barrier race15 HTTP 200, 15 SUPERADMIN accounts in 323 ms1 HTTP 200, 1 SUPERADMIN, 19 rejected with 9001evidence/poc-exploit.txt
authentication of race accountsPOST /api/auth/login → 200 for the created SUPERADMINs—evidence/poc-exploit.txt
database state15 SUPERADMIN rows, all created within the windowexactly 1 SUPERADMIN rowevidence/db-superadmins.txt
X-Forwarded-For acceptancedistinct header accepted (no limiter block)—evidence/poc-probe.txt

6. Environment preconditions

  • Podman with podman compose; --cpus 2 --memory 4g per container; isolated cve126937lab network.
  • Outbound network once, to pull the three official images.
  • Once setup completes, firstSetup stays false — reset the site between measurements (run-lab.sh sweep does it via SQL).

7. Additional findings (0-day sweep)

  • The fixed build behaves deterministically: in the same 20-thread race it created exactly one SUPERADMIN and rejected the other 19 requests with error 9001 through the pg_advisory_xact_lock transaction — the fix serializes the whole check-create-reset unit rather than narrowing the window.
  • The limiter bypass depends on CORE_TRUST_PROXY=true; with the flag off, all threads share one bucket and only a handful of requests land inside the window. The lab keeps the default proxy posture, matching real deployments.
  • The window is a genuine deployment-risk interval: it opens at server start and closes only when an administrator completes setup. Nothing in the vulnerable build logs or alerts on multiple SUPERADMIN creations; the lab's database evidence shows 15 rows created within a single 323 ms window without any countermeasure firing.
  • No additional /api/setup defects were found on 4.6.5: the raced requests are rejected in order, no partial user rows remain, and the fixed-site database holds exactly the legitimate setup account.

8. Repository layout

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.

    945
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    555
  • 3

    redforge

    cybersecurity91/redforge

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

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

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

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

    292

Explore all tools

Browse our collection of tools

View all tools →