Rapid7 Details Unpatched Gogs RCE via Git Rebase Argument Injection

· Original article ↗

Summary

Rapid7 reports a critical argument-injection flaw in Gogs that can let an authenticated user execute commands through the rebase-before-merging workflow. Gogs 0.14.2 and 0.15.0+dev were confirmed affected; no patch was available at publication.

Key points

  • The CWE-88 flaw is rated CVSSv4 9.4 and allows an authenticated user to achieve remote code execution as the Gogs server process.
  • A malicious branch name injects Git’s --exec option when Gogs runs git rebase during “Rebase before merging.”
  • Gogs 0.14.2 and 0.15.0+dev (commit b53d3162) were confirmed affected; earlier versions supporting rebase merging are considered likely vulnerable.
  • Default open registration and unrestricted repository creation can make the exploit path accessible to a newly registered user; users with write access to a qualifying repository may also exploit it.
  • Potential impact includes access to private repositories and stored credentials, server compromise, lateral movement, and modification of hosted code.
  • Rapid7 reported no patch at publication. Suggested mitigations include restricting registration and repository creation; administrators can also monitor logs and repositories for suspicious branch names and artifacts.

Article Details

Vulnerability Types
  • Argument injection
Severity
Critical (CVSS v4 9.4)
Affected Versions
  • Gogs 0.14.2
  • Gogs 0.15.0+dev (commit b53d3162)
Exploitation Status
reported
Exploit Availability
public_exploit
Patch Status
unavailable
Workarounds
  • Set DISABLE_REGISTRATION = true in app.ini to prevent untrusted users from creating accounts.
  • Set MAX_CREATION_LIMIT = 0 in app.ini or restrict repository creation per user; this does not block exploitation by users with write access to existing repositories.
  • Disable “Rebase before merging” on shared repositories where an attacker has write access but not admin privileges; repository owners or admins can re-enable it.

MITRE ATT&CK

People

Products

Tools

Related Articles