Skip to content
Exploit for CVE-2026

Exploit for CVE-2026

Sploitus • November 23, 2026

[![Research status: validated](

| **Component** | Gogs — `internal/database/repo_editor.go::isRepositoryGitPath` |

| **Fixed in** | **0.14.4** — commit `4301704` (GHSA-2jh3-23vq-6j44) |

| **CWE** | CWE-22 (Path Traversal), CWE-178 (Improper Handling of Case Sensitivity) |

| **Impact** | Gogs rejects repository uploads whose path contains a `.git` component, but the check only normalized trailing dots and spaces. On NTFS, `git~1` (8.3 short name), `.git::$INDEX_ALLOCATION` (alternate data stream) and other case variants resolve to the real `.git` directory, so an attacker could write files into a repository's Git metadata |

| **Vector** | file upload to a repository path containing an NTFS `.git` alias |

| **Trigger** | `repo/git~1/config` or `repo/.git::$INDEX_ALLOCATION/file` |

// repo_editor.go — pre-fix (verbatim in the lab)

for _, component := range strings.FieldsFunc(path, func(r rune) bool { return r == '/' || r == '\\' }) {

if strings.TrimRight(component, ". ") == ".git" {

// fixed (commit 4301704, verbatim in the lab)

case strings.HasPrefix(component, "git~1"): rest = component[len("git~1"):]

return strings.TrimRight(rest, ". ") == ""

The path guard compared each component literally against `.git` after

trimming trailing dots and spaces. NTFS resolves several other spellings to

the same directory: 8.3 short names (`git~1`), alternate data streams

(`.git::$INDEX_ALLOCATION`) and case variants. The fix replaces the literal

comparison with `isDotGit()`, modeled on Git's own `is_ntfs_dotgit`, which

covers those aliases before deciding whether to reject the upload.

| `gg-vuln` | `cve-2026-134808:vuln` | verbatim pre-fix path check |

| `gg-fixed` | `cve-2026-134808:fixed` | verbatim fixed check + `isDotGit()` |

| `poc` | `cve-2026-134808-poc:local` | stdlib-only Python driver |

Four path shapes are tested: short name, alternate data stream, classic `.git`

./run-lab.sh build # builds both sides (golang:1.24-alpine + python3)

./run-lab.sh up # cve134808lab network: gg-vuln / gg-fixed

* **check** — exit 1 when `repo/git~1/config` is accepted, 0 when it is

* **exploit** — narrated chain: NTFS alias path → literal comparison misses →

* **probe** — four path shapes with block decisions.

* **mitigation** — 0.14.4 / commit `4301704` / `isDotGit()`.

A standalone full-chain exploit ships at `exploit/exploit.py`:

python3 exploit/exploit.py --host=gg-vuln

# exit 1 on confirmed alias bypass, 0 on a safe target

| path | `gg-vuln` (< 0.14.4) | `gg-fixed` (0.14.4) |

| `repo/git~1/config` | **accepted — alias not recognized** | **blocked** |

| `repo/.git::$INDEX_ALLOCATION/file` | accepted | blocked |

| `repo/.git/config` | blocked | blocked |

| `repo/README.md` | accepted | accepted |

Captured runs: `evidence/check-*-run.txt`, `evidence/exploit-*-run.txt`,

`evidence/probe-*-run.txt`, `evidence/mitigation-*-run.txt`,

`evidence/exploit-standalone-run.txt`, `evidence/exploit-standalone-fixed-run.txt`,

`evidence/versions.txt`, `evidence/0day-sweep.txt`.

* Podman (or Docker); bounded containers on the isolated `cve134808lab`

network; Go 1.24 toolchain in the lab images.

* Real-world exploitation requires an NTFS-backed Gogs server and upload

## 7. Additional findings (0-day sweep on the fixed line)

`isDotGit()` follows Git's `is_ntfs_dotgit` semantics: 8.3 names, trailing

dots/spaces, alternate data streams and case-insensitive variants are all

recognized. Legitimate repository paths still pass on the fixed build, so

normal uploads are unaffected. No residual alias path was found on the fixed

run-lab.sh environment driver (build / up / sweep / down)

Makefile convenience targets

poc/poc.py the PoC (check / exploit / probe / mitigation)

exploit/exploit.py standalone full-chain exploit

lab/main-*.go verbatim path check per side

lab/lab.Dockerfile builds both sides with Go 1.24

lab/service.py HTTP wrapper (POST /check), child-process isolation

evidence/ captured runs of every mode on both sides

TRACKING.md excluded (working record)

* CVE record —

* GitHub advisory —

* Fix commit —

Extracted Entities

Companies (1)

Platforms (1)

Vulnerabilities (1)