CVE-2026-52806: Gogs Remote Code Execution via Git Rebase Argument Injection

gogs.io/gogs Updated 24 Jun 2026

Summary

23/06/2026
Yes i
Critical
9.9

CVE-2026-52806: Gogs vulnerable to RCE via git rebase --exec argument injection in pull request merge. Affects gogs.io/gogs versions < 0.14.3. Fixed in 0.14.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Gogs is an open-source self-hosted Git service that allows users to manage Git repositories, collaborate on projects, and facilitate code reviews through features like pull requests. It is designed for ease of use and is popular among developers and organizations for hosting their code. However, Gogs has a critical vulnerability that allows authenticated users to execute arbitrary code on the server through a flaw in the pull request merging process.

Vulnerability Detail

The vulnerability arises from Gogs allowing authenticated users to inject the '--exec' argument into the 'git rebase' command during the pull request merge operation. This occurs when a user creates a pull request with a specially crafted branch name that includes the '--exec' flag. The flaw is rooted in the way Gogs processes branch names without proper validation, leading to potential remote code execution (RCE) on the server. The ramifications are severe, as an attacker could gain full control over the server, access sensitive data, and compromise other repositories hosted on the same instance.

How To Fix

Latest published version: v0.13.3 as of 22 Oct 2026

go get gogs.io/gogs@v0.13.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.14.3

This is the first release that contains the fix.

go get gogs.io/gogs@v0.14.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can disable the 'Rebase before merging' option in the repository settings to prevent exploitation until the package is updated. This can be done by navigating to the repository settings and unchecking the 'Allow rebase' option.

Conclusion

CVE-2026-52806 is a critical vulnerability in Gogs that allows for remote code execution through improper handling of branch names during pull request merges. Users are strongly advised to update to the latest version to mitigate this risk and ensure the security of their Gogs instances.

See every vulnerability recorded for gogs.io/gogs →

Share this vulnerability

FAQ

CVE-2026-52806 is a critical vulnerability in Gogs that allows authenticated users to execute arbitrary code on the server through a flaw in the pull request merging process.

You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities. Visit Vulert Scanner to check if your application is affected without requiring any signup.

The vulnerability can lead to server compromise, data breaches, credential theft, and supply chain attacks, allowing attackers to execute arbitrary commands on the server.

Download the latest version of Gogs (0.14.3 or later) from the official repository and follow the installation instructions to update your instance.

If immediate updating is not possible, disable the 'Rebase before merging' option in your repository settings to mitigate the risk until you can apply the patch.

Related vulnerabilities

Recent vulnerabilities recorded for gogs.io/gogs.

How To Fix

Latest published version: v0.13.3 as of 22 Oct 2026

go get gogs.io/gogs@v0.13.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.14.3

This is the first release that contains the fix.

go get gogs.io/gogs@v0.14.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback