...

CVE-2026-85706 – GitLab Unauthenticated Arbitrary File Read

Venkat

On 10 September 2026, GitLab shipped patches for CVE-2026-85706, an unauthenticated arbitrary file read carrying a CVSS 10.0 and already on the CISA Known Exploited Vulnerabilities (KEV) list. No credentials, no user interaction — a single crafted request reads any file the GitLab process can access, including secrets, tokens, and configuration.

The root cause is not a single coding mistake but a parser differential: GitLab Workhorse (Go) and Rails/Grape (Ruby) disagree on how to interpret the same URL. An attacker exploits that disagreement to skip Workhorse’s upload-security handoff, land on a handler that trusts an attacker-controlled file.path, and exfiltrate file contents through a leaky error message.

Who needs to act now: anyone running self-managed GitLab CE/EE on affected versions. This is a patch-immediately situation, and if you were exposed to the internet before you patched, it’s also an assume-compromise situation.

Field

Detail

CVE

CVE-2026-85706

Class

Unauthenticated arbitrary file read (path traversal / parser differential)

CVSS

10.0 (Critical)

Exploited in the wild

Yes — CISA KEV listed

Affected

CE/EE 18.7 → 19.1.8, 19.2 → 19.2.6, 19.3 → 19.3.2

Fixed

19.1.8, 19.2.6, 19.3.2 (2026-09-10)

Impact

Disclosure of secrets, tokens, config, source — frequently a stepping stone to full compromise

Why this matters beyond “another GitLab CVE”

Self-managed GitLab is rarely just a code host. It typically holds:

  • CI/CD secrets — cloud credentials, registry tokens, deploy keys
  • secrets.yml / gitlab.yml — the Rails secret key base, DB credentials, SMTP creds
  • Source code for your entire estate
  • Personal access tokens and runner registration tokens

An arbitrary file read against that host is not “information disclosure” in the low-severity sense. Reading gitlab-secrets.json or the Rails secret key base commonly enables session forgery and privilege escalation; reading CI configuration and env files hands an attacker the keys to your build and deploy pipeline. That’s why this rates a 10.0 and why it’s being actively exploited.

Background: how a request flows through GitLab

To understand the bug you need to know the request pipeline, because the vulnerability lives between two of these layers — not inside any one of them.

Internet

    |

    v

  NGINX  –>  Workhorse  –>  Puma  –>  Grape / Rails app

 (proxy)       (Go)         (Ruby)         (Ruby)

Component

Role

NGINX

Outermost reverse proxy. TLS termination, static files, forwards the rest inward. Not directly involved in this bug.

Workhorse

GitLab’s Go reverse proxy. For upload endpoints it buffers the body to a temp file, signs a JWT, and rewrites file.path so Ruby never handles raw upload bytes. It stamps a Gitlab-Workhorse-Api-Request JWT on every forwarded request — this proves “came through the proxy,” not “user is authenticated.”

Puma

The Ruby application server running Rails.

Rack

Ruby’s web-server interface layer. Handles query-string parsing and verifies Workhorse’s upload JWT. Rack::Utils.parse_nested_query is the function whose error message leaks file bytes in this exploit.

Grape

REST framework behind all /api/v4/ routes. Provides before-filters like require_gitlab_workhorse! (proxy check) and authenticate! (identity check). It routes on the decoded* URL path.

Rails

The monolith everything runs inside.

NOTE

The single most important detail: Workhorse matches upload routes on the encoded path; Grape/Rails routes on the decoded path. Hold that thought.

Root cause: four failures stacked

This exploit only works because four things line up. Any one of them fixed in isolation would have broken the chain — which is exactly why the patch touches several.

1. The parser differential

Workhorse decides “is this an upload route I need to intercept?” by matching a regex against r.URL.EscapedPath() — the URL-encoded path. Rails/Grape decides “which handler runs?” by routing on the decoded path. Encode one character of files as its percent-equivalent:

%63ommits  ->  Workhorse's regex sees the literal "%63ommits"  ->  no match

           ->  Rails decodes %63 = 'c'  ->  sees "commits"  ->  real handler

So Workhorse concludes “not an upload, nothing for me to intercept” — while Rails dispatches the same request to the upload-capable handler. Same request, two different realities.

2. The handoff gets skipped

Because Workhorse decided the request wasn’t an upload, it never buffers the body to a temp file, never rewrites file.path to a signed path-confined location, and never sets the Gitlab-Workhorse-Multipart-Fields header.

But it still forwards the request — with a valid Gitlab-Workhorse-Api-Request JWT attached. To Rails this looks like a legitimately proxied request. The attacker’s raw file.path parameter survives the trip untouched, because the component whose entire job was to overwrite it never ran.

3. Missing auth + raw-parameter trust

The reached endpoint had no authenticate! before-filter — the proxy check passed because the Workhorse JWT was present, but nothing verified a user. Then the handler read:

params['file.path']    # the attacker's raw string - e.g. /etc/passwd
                       # instead of:
params[:file]          # the UploadedFile Workhorse was supposed to build

So file.path=/etc/passwd is taken at face value and read from disk. No credentials anywhere in the chain.

POST /api/v4/projects/1/repository/%63ommits?file=&file.path=/flag.txt&file.size=1
                                   ^^^^^^^^  Workhorse misses -> raw file.path reaches Rails

4. Exfiltration through a leaky error message

Reading the file is one thing; getting the bytes back is another. This is where Rack::Utils.parse_nested_query becomes the exfil channel. When it chokes on invalid percent-encoding, its error string embeds the offending input:

🌐
filename.html
invalid %-encoding (<file bytes up to the first stray % or NUL>)

The application reflects e.message back in the HTTP response — so the response body contains the file’s contents, up to the first byte that breaks the parser. Iterated cleverly, an attacker walks through a file.

NOTE

The mental model: one layer’s “definitely not an upload” is another layer’s “of course it’s an upload,” the security handoff falls into the gap, an unauthenticated handler trusts attacker input, and an over-helpful error message reads the loot back out loud.

The patch — what changed and why it’s the right fix

GitLab’s fix (v19.3.1 → v19.3.2, and the parallel backports) addresses the chain at multiple points rather than just plugging the encoding trick:

  1. Adds authenticate! to the affected endpoints — a request with no user identity is now rejected regardless of how it was routed.
  2. Switches to the verified UploadedFile — the handler consumes params[:file] (the Workhorse-built, path-confined object) instead of the raw params[‘file.path’] string.
  3. Stops reflecting e.message — the error path no longer echoes parser input back to the caller, closing the exfiltration channel.

CONSULTANT NOTE

The defensive lesson for your own systems: the durable fix wasn’t “normalize the path better.” It was eliminate trust in a parameter that a different layer was responsible for sanitizing. Any time security depends on Component A rewriting something before Component B reads it, a routing or parsing disagreement between A and B is a latent critical bug. If you build multi-layer request pipelines, that’s the pattern to hunt for.

Detecting exposure – safely

You do not need to run the file-read exploit to know whether you’re exposed. Two non-destructive checks:

Version check (authoritative)

Confirm your running version against the fixed list. Anything below 19.1.8, 19.2.6, or 19.3.2 on an affected branch is vulnerable.

🌐
filename.html
# On the GitLab host
gitlab-rake gitlab:env:info | grep -i version
# or
cat /opt/gitlab/version-manifest.txt | grep -i gitlab

For fleets, pull the version from your inventory/CMDB or scrape the login page’s build metadata across hosts rather than touching each box by hand.

Non-destructive existence oracle

The safe detection technique distinguishes a patched from an unpatched host by the type of response to the crafted route — without actually reading a sensitive file. An unpatched host reaches the vulnerable handler; a patched host rejects the request at the authenticate! filter. This is the logic behind the repo’s detect.sh and the public Nuclei template (projectdiscovery/nuclei-templates PR #17231).

CONSULTANT NOTE

Operational note for consultants: run detection only against assets you own or are explicitly authorized to test, and prefer the version check as your primary signal for client estates. The oracle is for confirmation and for validating that a patch actually took effect.

Detection engineering – what your SOC should alert on

Even after patching, hunt historically. If your GitLab was internet-reachable while unpatched, look back through logs from before your upgrade.

Request signatures (NGINX / Workhorse / Rails logs):

  • Percent-encoded route segments that decode to commits or files on /api/v4/projects/*/repository/* — e.g. paths containing %63ommits or %66iles, or other single-character encodings of upload route keywords.
  • Requests carrying a file.path query parameter pointing at absolute paths (/etc/, /var/opt/gitlab/, /opt/gitlab/) on API upload routes.
  • API upload-endpoint hits that lack the normal Workhorse multipart headers you’d expect on a genuine upload.

Response-side signal:

  • Response bodies containing invalid %-encoding on API routes — a strong indicator someone exercised the exfil channel.

WAF / reverse-proxy mitigations (defense-in-depth, not a substitute for patching):

  • Normalize/decode the URL path before rule evaluation, then block or flag encoded upload-route keywords.
  • Deny file.path (and absolute-path values in it) on /api/v4/*.
  • Alert on any %-encoded alphanumerics inside API path segments — legitimate clients rarely encode plain letters.

Feed these into your SIEM as detections, and treat pre-patch matches as incidents, not curiosities.

Remediation and compliance mapping

Here’s the split most clients actually need — what unblocks you now vs. what a mature program looks like.

✅  Good enough to close the finding / satisfy an auditor

Action

Why it satisfies the control

Upgrade to 19.1.8 / 19.2.6 / 19.3.2+

The only real remediation. Everything else is compensating.

Document the patch date and version in your change/vuln-management record

Evidence of timely remediation of a known-exploited CVE

Run the version + oracle check post-patch and save the output

Verification evidence that the fix took effect

If internet-exposed pre-patch: rotate GitLab secrets — secret key base, CI/CD variables, runner tokens, PATs, deploy keys

Demonstrates you addressed potential exposure, not just the vector

🚀  Mature / long-term posture

  • Get self-managed GitLab off the public internet — VPN/SSO-gated or behind an identity-aware proxy. Removes the entire unauthenticated-attacker class.
  • Emergency-patch SLA for KEV-listed CVEs — a defined, tested “critical + actively exploited → patch within N hours” path, distinct from your monthly cadence.
  • Automated version drift detection across all self-hosted dev infrastructure feeding your SIEM.
  • Secret rotation automation so “rotate everything” is a runbook, not a fire drill.

Framework crosswalk

Framework

Control(s)

What it expects here

SOC 2

CC7.1, CC7.2, CC6.6

Timely detection + remediation of the CVE; alerting on exploitation; ideally the asset isn’t nakedly internet-facing

ISO 27001:2022

A.8.8, A.8.28, A.8.16

Documented vuln-management process actioned against this CVE; monitoring for exploitation

PCI DSS 4.0

6.3.3, 11.5, 6.4.1

If GitLab touches CDE scope: patch fast, detect, WAF in front

NIST CSF 2.0

ID.RA, PR.PS, DE.CM, RS.MA

Identify exposure, patch, monitor, respond as an incident if pre-patch exposure existed

CONSULTANT NOTE

Consultant framing for client comms: “This is a CISA-KEV, CVSS-10 vulnerability. Under PCI DSS 6.3.3 and equivalent SOC 2 / ISO expectations, an actively-exploited critical must be remediated on an emergency timeline, not the standard patch window. Our recommendation is patch now, verify, and — if the host was internet-reachable before patching — treat it as a potential compromise and rotate secrets.”

Practical lab reproduction and evidence

⚠  CAUTION

This section is for your own authorized lab only. The steps below stand up an intentionally vulnerable, isolated GitLab instance on localhost. Do not point any of this at systems you don’t own. Unauthorized testing is illegal in most jurisdictions.

The exploitation below was performed against a local, intentionally vulnerable GitLab instance built from the EQSTLab PoC, exercising the commits-endpoint variant of the parser differential (%63ommits). All evidence that follows is captured from that lab.

Lab environment

  • Target: gitlab-ce 19.1.7-ce.0 (unpatched), built from the EQSTLab Dockerfile
  • Runtime: Docker on Kali Linux; container published on port 8088, reachable on its bridge IP (172.17.0.2)
  • Seeded state: /flag.txt (with a trailing % reflection trigger) and a public project victim/public-app (id 1), so the commits API is reachable unauthenticated
  • Tooling: the repo’s exploit.py — single unauthenticated request, –check (sink oracle) and –read (file read)

Bring-up

🌐
filename.html
# Build the vulnerable image
sudo docker build -t cve-2026-85706 .
 
# Run (--shm-size is mandatory or Postgres crash-loops)
docker run -d --name cve-2026-85706 --shm-size 256m -p 8088:80 cve-2026-85706
 
# Wait for the seeder to report ready (look for: [seed] SEED_DONE ...)
docker exec cve-2026-85706 tail -n 20 /var/log/seed.log
 
# Resolve the target address
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cve-2026-85706

Detection (non-destructive)

🌐
filename.html
python3 exploit.py 172.17.0.2 --check

File-read PoC

🌐
filename.html
# Default: read the seeded flag (content reflected via the % trigger)
python3 exploit.py 172.17.0.2
 
# Read a real config file - full content disclosure
python3 exploit.py 172.17.0.2 --read /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
 
# A file with no invalid '%' returns an existence oracle only
python3 exploit.py 172.17.0.2 --read /etc/passwd

NOTE

Two disclosure modes. Files whose bytes contain an invalid % (the seeded flag, gitlab.yml) reflect their content in the 400 error body. Files without one (/etc/passwd, some logs) are still read pre-auth but return an existence oracle only — proof the sink fired, without content on this channel. Both are shown below.

Captured evidence

Live captures from the lab described above.

Evidence 1 — Detection confirms vulnerable, and the flag is read

exploit.py –check reaches the file-read sink (file.path controlled), then a default run reads the seeded /flag.txt — content reflected via the trailing % trigger.

Evidence 2 — Arbitrary read of GitLab configuration (full content disclosure)

Unauthenticated read of config/gitlab.yml — real service configuration (host, ports, the git run-user, request-duration settings) disclosed with no credentials.

Evidence 3 — Existence oracle on a file with no reflectable byte

/etc/passwd is read pre-auth but contains no invalid % — the sink fires (confirming the vuln) while this channel returns an existence oracle rather than content.

Takeaways

  • Patch now. 19.1.8 / 19.2.6 / 19.3.2+ is the only real fix. It’s CISA-KEV listed and actively exploited — an emergency-patch item, not a next-sprint item.
  • If it was exposed pre-patch, assume secrets are compromised and rotate them.
  • The architectural lesson: parser/routing disagreements between layers are a critical-bug factory. Security that depends on Layer A sanitizing input before Layer B reads it breaks the moment A and B disagree about what the request even is.
  • The compliance angle: actively-exploited criticals live outside your normal patch cadence. If your program doesn’t have an emergency-patch lane for KEV-listed CVEs, this is the finding that justifies building one.

Leave a Reply