Skip to content
Threat Feed
high advisory PoC

Gogs: Path traversal via NTFS aliases in repository uploads (CVE-2026-134808)

Gogs versions before 0.14.4 on Windows are vulnerable to a path traversal attack that allows authenticated users with write access to overwrite critical Git metadata using NTFS aliases, enabling potential remote code execution.

CVE search metadata

CVE search record: CVE-2026-134808. Severity: high. CVSS: 7.5. KEV: no. Product: Gogs. Brief: Gogs: Path traversal via NTFS aliases in repository uploads (CVE-2026-134808). Brief link: https://feed.craftedsignal.io/briefs/2026-11-gogs-path-traversal-cve-2026-134808/

Triage facts

Revision 1
Applicability
Gogs
Evidence
Unknown
Severity
High
Action
Immediate escalation
Sources
5 public sources
Freshness
Revision 1Nov 23, 12:27 UTC
Vulnerabilities
1 CVE
Source quality
A1Likely

Overview

Gogs versions before 0.14.4 running on Windows contain a path equivalence vulnerability in the isRepositoryGitPath function. The application attempts to block uploads into .git directories, but the filtering logic only performed literal comparison after trimming trailing dots and spaces. An attacker can use NTFS-specific aliases such as 8.3 short names (git~1) or alternate data streams (.git::$INDEX_ALLOCATION) to bypass this check. Successfully bypassing the filter allows an attacker to overwrite sensitive files within the repository's .git directory, such as config or hooks, leading to command execution as the Gogs process.

Attack Chain

  1. Attacker authenticates to a Gogs instance with write access to a repository.
  2. Attacker crafts a file upload request with a destination path containing an NTFS alias, such as repo/git~1/config.
  3. Gogs processes the upload and passes the path to the vulnerable isRepositoryGitPath check.
  4. The check fails to normalize the NTFS alias and incorrectly identifies the path as benign.
  5. The application proceeds with the write operation, effectively targeting the real .git/config file instead of the intended location.
  6. The overwritten file is utilized by the Git service or system, resulting in unauthorized configuration changes or arbitrary code execution.

Impact

Successful exploitation allows authenticated users to achieve arbitrary file overwrite within the repository metadata. This can lead to full compromise of the repository, unauthorized configuration changes, and execution of arbitrary code with the privileges of the Gogs service.

Recommendation

Upgrade Gogs to version 0.14.4 or later immediately. This version introduces an NTFS-aware path matcher (isDotGit) that correctly handles 8.3 short names, alternate data streams, and case-insensitive variants, mitigating the path traversal vulnerability.


Immediate actions

Upgrade Gogs to 0.14.4 or later on all Windows instances

IT Operations 48h

Threat Hunt

Search Gogs server logs for anomalous repository file upload paths containing NTFS alias sequences such as 'git~1', '::%24INDEX_ALLOCATION', or case-variations of '.git'

T1190 high high confidence hunt now

Data: Gogs application access logs, Web server access logs

Mitigations

Update Gogs to 0.14.4

immediate IT Operations

CVE-2026-134808