New Rule - Gogs Rebase RCE Argument Injection via Git --exec Flag (Linux)#6039
New Rule - Gogs Rebase RCE Argument Injection via Git --exec Flag (Linux)#6039WRG-11 wants to merge 5 commits into
Conversation
|
Welcome 👋 It looks like this is your first pull request on the Sigma rules repository! Please make sure to read the SigmaHQ conventions to make sure your contribution is adhering to best practices and has all the necessary elements in place for a successful approval. Thanks again, and welcome to the Sigma community! 😃 |
swachchhanda000
left a comment
There was a problem hiding this comment.
Hi @WRG-11,
Thanks for your submission. Before we proceed with the review, here are a few suggestions:
- Rules targeting new CVEs, malware, or APTs, are generally tracked as Emerging Threat rules and have a dedicated space in the repository: https://github.com/SigmaHQ/sigma/tree/master/rules-emerging-threats
- Since a public PoC is available in Metasploit, it would be helpful if you could execute it and provide real logs. That would make it much easier to verify the detection logic instead of relying on assumptions. This would also strengthen the PR significantly and improve its chances of being merged compared to a long AI-generated summary or description.
This rule detects exploitation of CVE-2026-52806 in Gogs through argument injection in git rebase commands.
…_argument_injection.yml
|
Thanks @swachchhanda000, both make sense.
|
New Sigma Rule: Gogs Rebase RCE Argument Injection
Vulnerability
Gogs (the self-hosted Git service) passes a pull request's base branch name to
git rebasewithout a--separator. A branch named--exec=<cmd>isinterpreted by git as the
--execflag, executing arbitrary commands as theGogs server user. The flaw requires only an authenticated account; on instances
with open registration that means any user. A public Metasploit module exists
(
multi/http/gogs_rebase_rce). The issue is unpatched as of the Rapid7disclosure (2026-03-17).
Detection Logic
The rule uses three concurrent conditions:
/git- the git binary is executingrebaseAND (--execOR-x) - exec injection is present/gogs- the rebase was launched by the Gogs serverWhy the parent scope is the 0-FP discriminator:
git rebase --execis alegitimate developer feature (e.g.
git rebase --exec "make test"). A bareexec-flag selection would match benign developer activity. In the exploit, the
rebase is always launched by the Gogs server process; a developer or CI runner
launching the same command has a shell, IDE, or runner as the parent. The rule
fires only when all three conditions are true simultaneously.
Known limitation
If a Gogs deployment uses a shell intermediary (
gogs -> sh -c "git rebase --exec=<cmd>"),the git parent is
/sh, not/gogs, and this rule does not fire. This is acoverage gap, not a false positive.
Testing
Rule passes
sigma checkwithtests/sigma_cli_conf.ymlvalidation config:0 errors, 0 condition errors, 0 issues. Also passes the legacy
tests/test_rules.pysuite (11/11).