All vulnerabilities

Servers and applications

CVE-2026-82401

Arbitrary file write via git diff --output argument injection in DiffBinary

Severity
Critical 9.6
Published
24 Nov 2026
Last changed
24 Nov 2026
Added to UpHeron
24 Nov 2026
Fixed in
0.14.4
Weakness
Argument injection (CWE-88)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Change data · Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H
Also known as
GHSA-2grc-qr7q-6m36
Sources
Project advisories (GitHub)

Description

The DiffBinary() function in gogs/git-module passes user-controlled branch names to git diff --full-index --binary without --end-of-options. An attacker who pushes a branch named --output=/path/to/target can trigger arbitrary file writes on the server by creating a pull request.

git-module/repo_diff.go:163-173 constructs the diff command as:

When head = "--output=/path/to/target", git interprets it as the --output option, writing diff content to an attacker-specified path.

  • Attacker pushes branch named --output=/tmp/pwned via: git update-ref 'refs/heads/--output=/tmp/pwned' HEAD && git push origin 'refs/heads/--output=/tmp/pwned'
  • Attacker creates PR via compare URL: /:owner/:repo/compare/main...--output=/tmp/pwned
  • ParseCompareInfo at route/repo/pull.go:462,470 parses headRef = "--output=/tmp/pwned" from URL
  • RevParse("--output=/tmp/pwned") at line 532 — succeeds (git rev-parse doesn't recognize --output as its own option, exits 0)
  • MergeBase with --end-of-options at line…
From gogs/gogs's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
GogsServers and applications · github:gogs/gogs
  • Every version before 0.14.4

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