GitLab CE/EE Unauthenticated Arbitrary File Read via Repository Commits API (CVE-2026-85706)
Published: 2026-11-25 • Researcher: guneykabel (write-up and PoC); s3ntago (original vulnerability report, per upstream README)
Exploitation signals
Confirmed exploited in the wild. Added to CISA KEV 2026-09-11. Federal remediation deadline 2026-09-14.
EPSS 8.7% · 96th percentile
- Severity
- Critical
- CVE
- CVE-2026-85706
- Category
- web
- Affected product
- GitLab Community Edition and Enterprise Edition (repository commits API and repository files API, Rails + Workhorse)
- Affected versions
- All versions before 18.11.12, 19.0.9, 19.1.8, 19.2.6 and 19.3.2 (NVD ranges). Upstream README narrows the practical range to 18.7–19.1.7, 19.2.0–19.2.5 and 19.3.0–19.3.1; fixed in 19.1.8, 19.2.6 and 19.3.2 on 2026-09-10.
- Disclosed
- 2026-11-25
- Patch status
- Patched
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-85706
- https://github.com/guneykabel/cve-2026-85706
- https://gitlab.com/gitlab-org/gitlab/-/commit/0d9ce3e758a85f0690be751e213625f7902c0361
- https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-3-2-released/
- https://securityonline.info/gitlab-vulnerabilities-cve-2026-85706-cvss-10/
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-25 |
| Last Updated | 2026-09-11 |
| Author / Researcher | guneykabel (write-up and PoC); s3ntago (original vulnerability report, per upstream README) |
| CVE / Advisory | CVE-2026-85706 |
| Category | web |
| Severity | Critical |
| CVSS Score | 10.0 (base score as published; the vector string was not included in the source data — see references) |
| Status | PoC |
| Tags | LFI, arbitrary-file-read, unauthenticated, GitLab, path-traversal, CWE-22, Workhorse-bypass, encoding-mismatch, Ruby, KEV |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | GitLab Community Edition and Enterprise Edition (repository commits API and repository files API, Rails + Workhorse) |
| Versions Affected | All versions before 18.11.12, 19.0.9, 19.1.8, 19.2.6 and 19.3.2 (NVD ranges). Upstream README narrows the practical range to 18.7–19.1.7, 19.2.0–19.2.5 and 19.3.0–19.3.1; fixed in 19.1.8, 19.2.6 and 19.3.2 on 2026-09-10. |
| Language / Platform | Ruby (GitLab Rails, Grape, Puma) with Go (GitLab Workhorse); Linux, Omnibus package or Docker image |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
GitLab CE/EE before 18.11.12, 19.0.9, 19.1.8, 19.2.6 and 19.3.2 allow an unauthenticated user to read arbitrary files from the server because of improper path confinement and missing authentication enforcement in the repository commits API. The Rails handlers for the commits and files endpoints take the on-disk path directly from the raw file path request parameter and open the file before any authentication check, while the Workhorse requirement is satisfied by the JWT that Workhorse attaches to every request it proxies. A mismatch between the escaped path Workhorse matches and the percent-decoded path Puma hands to Grape lets a request reach the vulnerable handler without being rewritten into an upload. Upstream also documents that the urlencoded branch parses the file contents with Rack nested query parsing and echoes parser errors, so a file containing a stray percent sign is returned in the error body. The vulnerability was reportedly exploited in the wild and was added to the CISA KEV catalogue.
Vulnerability Details
Root Cause
The vulnerable Rails endpoints (POST :id/repository/commits and POST/PUT :id/repository/files/:file_path) sit behind Workhorse’s requestBodyUploader. The handler reads the on-disk path straight from the raw file.path request field and calls File.open on it before any authorization check runs. The require_gitlab_workhorse! guard does not act as an authentication control, because Workhorse’s signing round-tripper attaches a valid Gitlab-Workhorse-Api-Request JWT to every request it proxies, so anything that falls through to the generic API proxy passes the check. The intended protection was that Workhorse rewrites the request into a normal upload first, but its route regex matches against the escaped path (EscapedPath(), plus a path.Clean clone that never decodes percent escapes), while Puma decodes percent escapes before Grape routing. Percent-encoding any character of a static segment, adding a trailing slash, or appending .json therefore makes Workhorse miss the route while Rails still routes to the vulnerable handler.
Attack Vector
An unauthenticated attacker sends an HTTP request to /api/v4/projects/
Impact
Arbitrary local file disclosure from the GitLab server as the GitLab Rails user, without authentication. In the reference chain the file bytes are returned only when the content is parseable by the urlencoded branch as a file containing a percent sign not followed by two hex digits; the resulting Rack::Utils.parse_nested_query error is interpolated into the 400 response body. For files without such a trigger character the read still occurs and the response acts as a file-existence and readability oracle, but the content is not echoed. Files readable by the GitLab user can include gitlab.yml with database and SMTP credentials, secret files, and CI or project data.
Environment / Lab Setup
OS: Linux x86_64 (Docker or Omnibus host)
Target: GitLab CE/EE in an affected range, e.g. 19.1.7, 19.2.5 or 19.3.1
(docker image gitlab/gitlab-ce:19.1.7-ce.0 or equivalent Omnibus build)
Attacker: Python 3.8+ with the requests library, same host or LAN
Tools: Python 3, requests, curlSetup Steps
| |
Proof of Concept
Step-by-Step Reproduction
- Choose a target file — pick an absolute path readable by the GitLab Rails user; /etc/hostname is a safe first check, gitlab.yml is the high-value target.
- Build the bypass URL — keep the static repository segment partially percent-encoded, or add a trailing slash or .json suffix, so Workhorse’s escaped-path regex does not match and does not rewrite the request. The upstream README notes that //, /./, %2F and semicolon variants fail.
- Send forged upload metadata as query parameters — file= (blank), file.path=
, file.size=1, Content-Type=application/x-www-form-urlencoded. The blank file passes the WorkhorseFile validation, and the read happens before authentication. - Iterate the probe forms — the PoC cycles through encoded commits, encoded files, trailing-slash and .json forms with POST and PUT, and classifies each response (rewrite, missing, leak, leak-fragment, read-noecho, project-gate, noroute) so a failed probe shows where the chain broke.
- Recover content or confirm the read — if the target file contains a percent sign not followed by two hex digits, the 400 error body contains the file bytes; otherwise a read-noecho or missing verdict confirms pre-auth file access and existence.
Exploit Code
See
exploit.pyin this folder; the upstream write-up is archived asupstream-README.md.
The request shape used by the PoC:
| |
| |
Expected Output
| |
For a target file without a stray percent sign the tool reports read-noecho or missing instead:
| |
Detection & Indicators of Compromise
- Requests to /api/v4/projects//repository/commits or /api/v4/projects//repository/files/* whose static segments contain percent-encoded characters, a trailing slash variant, or a .json suffix.
- Query strings carrying upload metadata normally produced by Workhorse: a blank file parameter plus file.path, file.size and an explicit Content-Type=application/x-www-form-urlencoded query parameter, especially with an absolute file.path value.
- 400 responses whose body contains “Invalid parameter: invalid %-encoding” followed by file content, or “Invalid parameter type” fragments.
- 401 or validation-error responses (branch is required, commit_message is required) to these requests without any session cookie, private token or Authorization header — the read has already occurred.
- GitLab production_json.log / api_json.log entries for the repository endpoints with no authenticated user and anomalous path encoding; pair with Workhorse or reverse-proxy access logs.
SIEM / IDS rule (example):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade to 19.1.8, 19.2.6 or 19.3.2 (or later). The fix adds authenticate! to all three endpoints plus the /authorize pre-step, trusts only the middleware-produced UploadedFile for path and size, and stops echoing parser errors (master commit 0d9ce3e7; backports 1fe30154, b43c8b26, 0ff7b6b2). |
| Workaround | No clean workaround is documented; restrict network access to the GitLab HTTP endpoint to trusted users and block unauthenticated /api/v4/projects//repository/ requests at the reverse proxy, and hunt for prior exploitation before patching. |
| Config Hardening | Keep the GitLab instance off the public internet or behind an authenticating proxy, run Rails workers as an unprivileged account with a minimal readable file set, rotate secrets stored in gitlab.yml if a probe may have succeeded, and alert on percent-encoded repository paths with upload-style query parameters. |
References
Notes
Auto-ingested from https://github.com/guneykabel/cve-2026-85706 on 2026-11-25.
Review verdict: this is a real exploit, not a detector. The single Python script performs the unauthenticated read against the live GitLab API, cycles through the vendor-verified Workhorse bypass forms, and exfiltrates content through the parser-error echo; the repository classifies responses so testers can see where a probe failed. Status is recorded as PoC rather than Weaponized because content recovery is conditional: the echo only fires when the target file contains a percent sign not followed by two hex digits, the leak regex is greedy up to the last closing parenthesis in the body, and the commits API additionally requires an anonymously readable project id (the files API does not). For files without a trigger character the exploit still proves pre-auth file access and yields a file-existence oracle, which is why it is not a full blind-read primitive.
The upstream repository contains no LICENSE file; the two source files are archived with attribution and a research-only header for authorized testing. The tool was not executed during ingestion. The commit date 2026-09-11 is used as Last Updated.
| |