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-104129 — Proof-of-concept and differential lab for CVE-2026-104129, demonstrating SQL injection through prest's _groupby parameter via nested subqueries and trailing UNION SELECT. | Kitploit
Tools/GitHubGitHub/googlesky/cve-2026-104129
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationWeb SecurityPapers & ResearchLabs & Practice
GitHubgooglesky/cve-2026-104129

CVE-2026-104129

Proof-of-concept and differential lab for CVE-2026-104129, demonstrating SQL injection through prest's _groupby parameter via nested subqueries and trailing UNION SELECT.

View Repository
1 day agoNot yet reviewed

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.

    901
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    861
  • 3

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    668
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

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

    414
  • 6

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    401

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-104129 — prest: SQL injection through _groupby after an incomplete fix

License: MIT Research status: validated

CVECVE-2026-104129
Componentprest — adapters/postgres/postgres.go::isSafeSQLExpression / GroupByClause
Affected<= 1.5.5 (and the _groupby path in the v2.3.0-era code carrying the weak validator)
Fixed incommit 084348fa (Fix: six SQL-injection-adjacent security gaps, GHSA-v9v2-98xq-627c)
CWECWE-89 (SQL Injection), CWE-693 (Protection Mechanism Failure)
ImpactThe earlier advisory hardened _select with sanitizeSelectField() but left the sibling _groupby path on the weaker isSafeSQLExpression(). That gate validated only the outermost function name against an allowlist and permitted spaces, single quotes and balanced parentheses — so a nested (SELECT ...) subquery or a trailing UNION SELECT ... was accepted and concatenated into the raw GROUP BY clause. controllers/crud.go calls GroupByClause unconditionally and executes the resulting query with only WHERE values parameterized; the table read-permission check is passable unauthenticated in the default configuration
VectorUnauthenticated GET /{db}/{schema}/{table}?_select=id&_groupby=...
Trigger_groupby=upper((SELECT 1)) UNION SELECT current_user

The vulnerable gate checked balance but not structure:

// postgres.go — pre-fix (excerpt, verbatim in the lab)
funcName := strings.ToLower(strings.TrimSpace(expr[:idx]))
if _, ok := allowedGroupByFunctions[funcName]; !ok { return false }
// ... character scan allows '(' and ')' across the WHOLE expression ...
balance := 0   // balanced parens == "safe", trailing UNION ignored

The fix validates the argument slice only and forbids nested parens:

// fixed (commit 084348fa, verbatim in the lab)
if !strings.HasSuffix(expr, ")") { return false }
args := expr[idx+1 : len(expr)-1]
if strings.ContainsAny(args, "()") { return false }
for _, ch := range args { /* strict character allowlist */ }

1. Root cause

The _select injection fix introduced sanitizeSelectField() but did not route the sibling _groupby parameter through it. GroupByClause still used isSafeSQLExpression(), which determined safety from the outer function name, a character allowlist that included parentheses, and a simple balance count. An expression like upper((SELECT 1)) UNION SELECT current_user has an allowlisted outer function and balanced parentheses, so it passed and was appended as raw SQL; the trailing UNION SELECT and the nested subquery were never inspected. The fix requires the expression to end at the outer closing paren, rejects any parenthesis inside the argument slice, and applies the character allowlist to the arguments only — closing both the subquery and trailing-statement gaps.

2. Reproduction environment

serviceimagerole
pr-vulncve-2026-104129:vulnvalidator from 084348fa^ (weak)
pr-fixedcve-2026-104129:fixedvalidator from 084348fa (hardened)
poccve-2026-104129-poc:localstdlib-only Python driver

The lab compiles the verbatim isSafeSQLExpression() and allowedGroupByFunctions map from each commit with a stub SQL builder that mirrors the raw clause concatenation in controllers/crud.go. Modes: inject (trailing UNION), subquery (nested SELECT), normal (allowlisted call) and comment (already-blocked control).

3. Running the environment

./run-lab.sh build     # builds both sides (golang:1.24-alpine + python3 service)
./run-lab.sh up        # cve104129lab network: pr-vuln / pr-fixed
./run-lab.sh sweep
./run-lab.sh down

4. The PoC

poc/poc.py (stdlib only):

  • check — exit 1 when the malicious expression is accepted and reaches the generated SQL, 0 when it is rejected; 3 no worker, 2 unreachable/indeterminate.
  • exploit — narrated chain: unauthenticated _groupby → weak outer-name check → raw GROUP BY with UNION/subquery → data extraction.
  • probe — both injection shapes plus two controls.
  • mitigation — commit 084348fa / strict argument-slice validation.

A standalone full-chain exploit ships at exploit/exploit.py:

python3 exploit/exploit.py --host=pr-vuln
# exit 1 on confirmed injected GROUP BY, 0 on a safe target

5. Expected results

_groupby valuepr-vuln (084348fa^)pr-fixed (084348fa)
upper((SELECT 1)) UNION SELECT current_useraccepted — raw SQL contains the UNIONrejected — plain query
upper((SELECT secret FROM hidden))accepted — nested subquery in SQLrejected
upper(name) (control)acceptedaccepted
upper(name); DROP TABLE users (control)rejectedrejected

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

6. Environment preconditions

  • Podman (or Docker); bounded containers on the isolated cve104129lab network; Go 1.24 toolchain in the lab images.
  • Real-world exploitation requires an unauthenticated client able to reach a prest list endpoint whose default configuration permits table reads.

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

The hardened validator requires the expression to end with ), bans parens inside the argument slice, and applies the strict character allowlist only to those arguments — both the trailing-statement and nested-subquery shapes are rejected. Legitimate allowlisted expressions still build SQL on the fixed build, and the previously blocked semicolon/comment payload stays blocked, so the fix is neither over-broad nor a regression.

8. Repository layout

README.md             this write-up
run-lab.sh            environment driver (build / up / sweep / down)
Makefile              convenience targets
poc/poc.py            the PoC (check / exploit / probe / mitigation)
exploit/exploit.py    standalone full-chain exploit
lab/main-vuln.go      upstream weak validator + allowlist + stub builder
lab/main-fixed.go     upstream hardened validator + allowlist + stub builder
lab/lab.Dockerfile    builds both sides with Go 1.24
lab/service.py        HTTP wrapper (POST /groupby), child-process isolation
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-104129
  • GitHub advisory — https://github.com/prest/prest/security/advisories/GHSA-v9v2-98xq-627c
  • Fix commit — https://github.com/prest/prest/commit/084348fa82701b098492fc520557ff290b7691e2
Download Tool