CVE-2026-52806: Gogs Remote Code Execution via git rebase argument injection

CVE-2026-52806 · Severity: critical · CVSS 9.9 · Published 2026-06-24

Gogs is a self-hosted Git service used by organizations to manage source code. A vulnerability in the way it handles pull requests allows a logged-in user to execute arbitrary commands on the underlying server. This could lead to a total compromise of the server, including the theft of all hosted private code, user credentials, and the ability to modify software projects without detection.

Technologies: gogs.io/gogs (Go), Gogs. Vendors: Go, Gogs.

Quick answers

Is CVE-2026-52806 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-52806 being exploited in the wild.
How severe is CVE-2026-52806?
Critical severity, with a CVSS score of 9.9, published 24 June 2026.
Which products and versions are affected?
gogs.io/gogs (Go) < 0.14.3, SEMVER:introduced=0, SEMVER:introduced=0,fixed=0.14.3; Gogs < 0.14.3.
Is there a fix for CVE-2026-52806?
Yes. gogs.io/gogs (Go): upgrade to 0.14.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-52806 attacked?
It is attacked over the network, in a network appliance.
Am I affected by CVE-2026-52806?
Check whether you run gogs.io/gogs (Go) or Gogs at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • gogs.io/gogs (Go): upgrade to 0.14.3 or later
    go get gogs.io/gogs@v0.14.3

Technical details

A command injection vulnerability exists in Gogs prior to version 0.14.3 within the pull request merge logic. When the 'Rebase before merging' option is used, the application passes the base branch name to the 'git rebase' command without proper sanitization or the use of the '--' separator. An authenticated attacker can create a repository with a maliciously crafted branch name (e.g., starting with '--exec=') that injects flags into the git command. Because 'git rebase --exec' executes commands via the system shell, this results in arbitrary code execution under the context of the Gogs process user. The vulnerability is particularly severe because Gogs often has open registration enabled by default, and any user can enable the required rebase settings on their own repositories.

Affected products

  • Gogs Gogs < 0.14.3

Identifiers

  • CVE-2026-52806
  • GHSA-qf6p-p7ww-cwr9
  • GO-2026-5580

Timeline

  • 2026-05-29: other: Initial fix proposed via pull request
  • 2026-06-07: patched: Version 0.14.3 released
  • 2026-06-19: advisory: GitHub Security Advisory published
  • 2026-06-24: disclosed: NVD publication date

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.