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
Tools/GitHubGitHub/googlesky/cve-2026-131873
Dynamic Analysis (Sandboxing)ExploitationFuzzingPapers & ResearchBinary Exploitation
GitHubgooglesky/cve-2026-131873

CVE-2026-131873

Proof-of-concept and exploit for CVE-2026-131873, a stack buffer overflow in Gargoyle's Plus interpreter ReadAction(), with an ASan/UBSan differential lab against the vendor fix.

View Repository
1 day agoNot yet reviewed
Share

CVE-2026-131873 — Gargoyle: stack buffer overflow in the Plus interpreter's ReadAction() via unterminated action conditions

License: MIT Research status: validated

CVECVE-2026-131873
ComponentGargoyle — bundled Plus interpreter, terps/plus/loaddatabase.c::ReadAction()
AffectedGargoyle 2023.1 through 2026.1.1
Fixed incommit 45385f1 (the Spatterlight 1.5.5 import) — genuine vendor fix
CWECWE-787 (Out-of-bounds Write), CWE-121 (Stack-based Buffer Overflow)
ImpactA crafted or truncated .plus game file crashes the interpreter with attacker-controlled values written past a 1024-entry stack array — arbitrary code execution is plausible in an unsanitized build; this lab proves the out-of-bounds write with ASan+UBSan on both builds
VectorFile format — a game library or upload service that opens an untrusted .plus file with Gargoyle/Spatterlight
Triggerone action whose condition chain never sets the 0x8000 terminator bit (a truncated file suffices — EOF makes ReadNum() return 0 forever)

ReadAction() writes condition/argument pairs into a fixed 1024-entry stack array without ever checking the index:

// terps/plus/loaddatabase.c @ 2026.1.1 (~L730)
uint16_t conditions[1024];
int condargs = 0;
while (reading_conditions) {
    uint16_t argcond = ReadNum(f) * 256 + ReadNum(f);
    if (argcond & 0x8000)
        reading_conditions = 0;
    argcond = argcond & 0x7fff;
    uint16_t argument = argcond >> 5;
    uint16_t condition = argcond & 0x1f;
    conditions[condargs++] = condition;   // ← unbounded
    conditions[condargs++] = argument;
}

The fix replaces this with AddCondition():

if (*condargs + 2 > MAX_CONDITION_ARGS)
    Fatal("Broken database!");

Both trees are compiled with ASan+UBSan and driven through the same headless harness that calls the real LoadDatabasePlaintext() loader.


1. Root cause

The condition chain is a variable-length sequence terminated by a high bit in the first byte of each 16-bit condition entry. ReadAction() assumes a well-formed game file will terminate before 1024 entries and never checks condargs. ReadNum() returns 0 on EOF, so a file truncated inside the chain turns the loop into an unbounded write of zeros past the stack array; a crafted file can choose every written value. The vendor's 1.5.5 import bounds-checks every append and aborts cleanly.

2. Reproduction environment

serviceimagerole
gargoyle-vulncve-2026-131873:vulnPlus loader from tag 2026.1.1 (ASan+UBSan)
gargoyle-fixedcve-2026-131873:fixedPlus loader from the fix commit 45385f1 (ASan+UBSan)
poccve-2026-131873-poc:localstdlib-only Python driver that writes the .plus bytes

The service models a game library: POST /load accepts raw .plus bytes, saves them, and runs the loader as a child process; the report contains the exit code, the sanitizer signature and the first lines of the sanitizer report. The harness is identical on both sides — it only supplies the common-layer globals that plusmain.c normally owns and calls the real plaintext loader.

3. Running the environment

./run-lab.sh build     # compile both Plus loaders with ASan+UBSan
./run-lab.sh up        # cve131873lab network: gargoyle-vuln / gargoyle-fixed
./run-lab.sh sweep     # check / exploit / probe / mitigation on both sides
./run-lab.sh down

4. The PoC

A standalone full-chain exploit script ships at exploit/exploit.py (python3 exploit/exploit.py --host=<target>; exit 1 on confirmed exploitation, 0 on a safe target).

poc/poc.py (stdlib only) writes a minimal plaintext database: a known game title, the 18-field header (NumActions=1), then an action with an unterminated condition chain. Modes:

  • check — control chain vs unterminated chain; exit 1 when ASan reports the stack overflow, 0 when the loader refuses safely, 3 no worker, 2 unreachable.
  • exploit — narrated stages with the sanitizer report quoted.
  • probe — terminated / unterminated / truncated / long chain matrix.
  • mitigation — the genuine vendor fix on the fixed side.

5. Expected results

casegargoyle-vuln (2026.1.1)gargoyle-fixed (fix commit)
terminated chain (control)loader continues to later (missing) sectionscondition chain accepted; later EOF → clean Fatal
unterminated chainUBSan OOB index + ASan stack-buffer-overflow, SIGABRTFatal: Broken database!, exit 1
truncated after 3 pairssame ASan crashFatal: Broken database!
long unterminated chainsame ASan crashFatal: Broken database!

Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt, evidence/probe-*-run.txt, evidence/mitigation-*-run.txt, evidence/versions.txt, evidence/0day-sweep.txt.

6. Environment preconditions

  • Podman (or Docker); containers bounded on the isolated cve131873lab network.
  • Outbound HTTPS at image build (GitHub: garglk clone; debian mirrors).
  • The plaintext header must carry exactly 18 comma-separated numbers; the vulnerable loader tolerates fewer, the fixed one does not (a harness detail, recorded in evidence/versions.txt).

7. Additional findings (0-day sweep on the fixed line)

The fixed build's AddCondition() closes every unterminated-chain form in the probe matrix, including a chain truncated after three pairs and a 4000-pair chain (evidence/0day-sweep.txt). The terminated-chain control reaches later sections of the deliberately minimal file and ends in a clean Fatal("EOF in string"), never an out-of-bounds write. No second unbounded append was found in the plaintext loader path.

8. Repository layout

README.md             this write-up
run-lab.sh            environment driver (build / up / sweep / down)
Makefile              convenience targets
exploit/exploit.py    standalone full-chain exploit
poc/poc.py            the PoC (check / exploit / probe / mitigation)
poc/Dockerfile        runner image (python:3.12-alpine)
lab/lab.Dockerfile    multi-stage build (both trees, ASan+UBSan)
lab/harness/          headless driver + common-layer stand-ins
lab/service.py        game-file loading service (POST /load)
evidence/             captured runs of every mode on both sides
TRACKING.md           excluded (working record)

9. References

  • CVE record — https://www.cve.org/CVERecord?id=CVE-2026-131873
  • Vendor fix commit — https://github.com/garglk/garglk/commit/45385f105b825521bf4296ef8d046fbbdd8dda7f
  • Pull request — https://github.com/garglk/garglk/pull/1041
  • Vulnerable code @ 2026.1.1 — https://github.com/garglk/garglk/blob/2026.1.1/terps/plus/loaddatabase.c#L732-L742
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.

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

    349
  • 4

    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.

    343
  • 5

    ARTEX

    baarai/artex

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

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

    295

Explore all tools

Browse our collection of tools

View all tools →