Rapid7 Discloses Unpatched Gogs RCE Flaw Exploitable by Authenticated Users

Summary
Rapid7 disclosed an unpatched Gogs flaw rated CVSS 9.4 that can let authenticated users execute code by injecting the --exec flag through a malicious branch name during rebase merging. It affects supported platforms; Rapid7 released a Metasploit module.
Key points
- Rapid7 says a malicious branch name can inject the --exec flag into git rebase during Gogs’s “Rebase before merging” flow.
- Exploitation requires an authenticated user; the article says users may create an account and repository on default-configured instances, or exploit a repository where they have write access and rebase merging is enabled.
- The flaw is rated CVSS 9.4, has no CVE identifier, and was reported to the maintainer on March 17, 2026; the article says it remains unpatched.
- Rapid7 reports that successful exploitation could expose other repositories and credentials on the server, enable access to network-accessible systems, and permit code tampering.
- The flaw reportedly affects Gogs deployments on Windows, Linux, and macOS and may enable cross-tenant access to private repositories.
- Rapid7 released a Metasploit module for Linux and Windows targets. Recommended mitigations include restricting registration and repository creation and auditing rebase merge settings.
Article Details
- Vulnerability Types
- Remote code execution (RCE) through injection of the --exec flag into git rebase
- Severity
- Critical (CVSS 9.4)
- Exploitation Status
- unknown
- Exploit Availability
- public_exploit
- Patch Status
- unavailable
- Workarounds
- Restrict user registration by setting DISABLE_REGISTRATION = true in app.ini.
- Restrict repository creation by setting MAX_CREATION_LIMIT = 0 in app.ini.
- Audit rebase merge settings.
MITRE ATT&CK
T1059 · Command and Scripting InterpreterThe vulnerability can cause git rebase to execute a shell command supplied through the injected --exec flag.T1190 · Exploit Public-Facing ApplicationAn authenticated user can exploit the Gogs vulnerability through the application to obtain server-side code execution.
