All vulnerabilities

Servers and applications

GHSA-hc35-pcqw-5xjq

NTFS $INDEX_ALLOCATION bypass allows authenticated RCE via Git hooks

Severity
Critical 9.9
Published
24 Nov 2026
Last changed
24 Nov 2026
Added to UpHeron
24 Nov 2026
Weakness
Path traversal (CWE-22)CWE-41Code injection (CWE-94)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Read data · Change data · Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Sources
Project advisories (GitHub)

Description

The fix in PR #8408 does not fully prevent writes into a repository's .git directory on Windows.

isRepositoryGitPath handles trailing dots and spaces, but does not account for NTFS Alternate Data Streams. On NTFS, the path:

.git::$INDEX_ALLOCATION/hooks/pre-commit

resolves to the real:

.git/hooks/pre-commit

The guard returns false for this path, allowing an authenticated user with repository write access to create a Git hook through the web editor.

Gogs then runs git commit without --no-verify, causing the planted hook to execute as the Gogs service account.

This results in authenticated remote code execution on Windows hosts.

The issue also existed before PR #8408. The new fix blocks trailing dot and space variants, but does not cover the NTFS ADS equivalent path.

The current guard in internal/database/repo_editor.go is:

For:

the first component remains:

after strings.TrimRight(component, ". ").

It therefore does not match .git, and the guard allows the path.

From gogs/gogs's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
GogsServers and applications · github:gogs/gogs
  • Every version up to 0.14.3

About Gogs

free forge based on Git written in Go

From Wikidata, CC0 1.0.
Docker Hub pulls
94,097,312Docker Hub, 22 Nov 2026
GitHub stars
47,981GitHub, 22 Nov 2026
Forks
5,081GitHub, 22 Nov 2026
Latest release
v0.14.4GitHub, 22 Nov 2026
Released
12 Nov 2026GitHub
Developer
FLOSS contributorWikidata
License
Expat licenseWikidata
Written in
Go, Cascading Style Sheets, JavaScriptWikidata
First released
11 Feb 2014Wikidata
First published on GitHub
12 Feb 2014GitHub

References