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
- Attacker authenticates to a Gogs instance with write access to a repository.
- Attacker crafts a file upload request with a destination path containing an NTFS alias, such as
repo/git~1/config. - Gogs processes the upload and passes the path to the vulnerable
isRepositoryGitPathcheck. - The check fails to normalize the NTFS alias and incorrectly identifies the path as benign.
- The application proceeds with the write operation, effectively targeting the real
.git/configfile instead of the intended location. - 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
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'
Data: Gogs application access logs, Web server access logs
Mitigations
Update Gogs to 0.14.4
CVE-2026-134808