What Happened
On March 17, 2026, Rapid7 researcher Jonah Burgess disclosed a critical remote code execution vulnerability in Gogs, a self-hosted Git service used by development teams. The flaw, rated 9.4 on CVSS, allows any authenticated user to execute arbitrary code on the server by creating a pull request with a specially crafted branch name that exploits the git rebase function.
As of this writing, the vulnerability remains unpatched. Approximately 1,141 internet-facing Gogs instances are potentially vulnerable. Burgess developed a Metasploit module that automates the entire exploit chain, demonstrating that exploitation requires minimal skill once an attacker has any level of authenticated access.
Timeline
March 17, 2026: Rapid7 publicly disclosed the vulnerability with technical details and proof-of-concept code.
Current status: No patch is available from the Gogs project. The vulnerability affects all known versions of Gogs where users can create pull requests and where repository maintainers have enabled interactive rebase functionality.
Which Controls Failed or Were Missing
Insufficient Input Validation
Gogs failed to sanitize branch names before passing them to the git rebase command. When a user creates a pull request, the application constructs shell commands using branch names without proper validation or escaping. An attacker can inject shell metacharacters into the branch name that execute when the rebase operation runs.
This violates basic secure coding principles: never trust user input, and never construct shell commands through string concatenation.
Overly Permissive Default Settings
The vulnerability requires that repository maintainers have enabled the "Allow Rebase" option in repository settings. While this isn't enabled by default for new repositories, many teams enable it for workflow convenience without understanding the security implications.
Your application settings should follow least-privilege principles. Features that execute potentially dangerous operations should require explicit opt-in with clear security warnings.
Missing Privilege Boundaries
Any authenticated user can trigger the vulnerability—you don't need repository write access or special permissions. Once you can create a pull request (even if it's never merged), you can execute code as the Gogs server process.
This represents a failure to enforce privilege boundaries between different user roles. Read or contributor access should never provide a path to code execution.
What the Relevant Standards Require
PCI DSS v4.0.1 Requirement 6.2.4
"Bespoke and custom software are reviewed prior to being released to production... to identify and correct potential coding vulnerabilities."
If you're running Gogs in an environment that processes payment data, this requirement applies. The code review process must specifically look for command injection vulnerabilities in any code path that handles user input. String concatenation to build shell commands is a red flag that should fail code review.
OWASP Top 10 2021: A03 Injection
Command injection sits squarely in the injection category. OWASP guidance is explicit: use parameterized APIs or escape all user input before passing it to interpreters. The Gogs vulnerability is a textbook example of what happens when developers ignore this guidance.
NIST 800-53 Rev 5: SI-10 (Information Input Validation)
"The information system checks the validity of information inputs."
Your systems must validate all inputs at trust boundaries. For Gogs, the trust boundary is where user-supplied branch names enter the rebase function. SI-10 requires that you define valid input syntax and reject anything that doesn't conform. Branch names containing shell metacharacters should fail validation.
ISO/IEC 27001:2022 Annex A.8.8 (Management of Technical Vulnerabilities)
"Information about technical vulnerabilities of information systems in use shall be obtained, the organization's exposure to such vulnerabilities shall be evaluated and appropriate measures shall be taken."
This control requires you to track vulnerabilities in your software supply chain—including self-hosted open source tools. When Rapid7 disclosed this vulnerability, your vulnerability management process should have flagged every Gogs instance in your environment for immediate action.
Lessons and Action Items for Your Team
Immediate: Disable Interactive Rebase
Log into every Gogs instance you manage. For each repository:
- Navigate to Settings → Options
- Find "Allow Rebase" or similar interactive rebase settings
- Disable them
This breaks the exploit chain. Without interactive rebase enabled, the malicious branch name can't trigger code execution. Yes, this impacts workflow for teams that rely on rebase. That's the cost of running unpatched software with a 9.4 CVSS vulnerability.
Short-term: Restrict Repository Creation
Limit who can create repositories and pull requests. The vulnerability requires authenticated access, but "authenticated" doesn't mean "trusted." Review your user provisioning:
- Remove inactive accounts
- Audit contractor and vendor access
- Implement approval workflows for new repository creation
- Consider requiring two-factor authentication for all users
Medium-term: Evaluate Migration Options
You're running software with a critical unpatched vulnerability and no clear timeline for a fix. This is the risk profile of abandoned open source projects. Evaluate alternatives:
- GitLab CE (Community Edition) has active security support
- Gitea (a Gogs fork) has a more active development community
- Hosted solutions (GitHub, GitLab SaaS) transfer security responsibility
Calculate the total cost of ownership, including the engineering time you're spending on emergency mitigation. Self-hosting saves licensing costs but creates operational overhead.
Long-term: Build Vendor Risk Assessment for OSS
Open source doesn't mean "free of risk." Add these criteria to your software evaluation process:
- Maintainer activity: When was the last commit? How many active contributors?
- Security response: Is there a published security policy? Do they use CVEs?
- Community size: How many production deployments? Is there a support ecosystem?
- Fork viability: If the project dies, can you maintain a fork?
Document these assessments. When a vulnerability like this appears, you need to make migration decisions quickly. Having the analysis already done lets you act instead of scramble.
Process Fix: Input Validation Standards
Review your secure coding standards. Add explicit requirements:
- Never concatenate user input into shell commands
- Use parameterized APIs or prepared statements
- Define allowlists for structured inputs (branch names, filenames, etc.)
- Fail closed: reject invalid input, don't try to sanitize it
If you're using static analysis tools, configure rules that flag string concatenation in any code path that touches exec(), system(), or similar functions.
The Gogs vulnerability is a reminder that self-hosted open source shifts security responsibility to you. When vendors don't patch, your only options are mitigation or migration. Both require preparation. Build the processes now so you're not making architecture decisions during an active incident.



