Detect CVE-2026-52806: Gogs RCE via git rebase --exec Argument Injection in PR Merge in Sumo Logic CSE
Detects exploitation of CVE-2026-52806, a critical command injection vulnerability (CWE-77) in Gogs versions prior to 0.14.3. An attacker can inject arbitrary shell commands via the git rebase --exec argument during pull request merge operations, leading to remote code execution on the Gogs server. A public PoC is available.
MITRE ATT&CK
- Tactic
- Execution Persistence Lateral Movement
Sumo Detection Query
_sourceCategory=endpoint OR _sourceCategory=os/linux OR _sourceCategory=os/windows
| where (_raw matches /git\s+rebase.*--exec/ or (_raw matches /gogs/ and _raw matches /(curl|wget|bash|\bsh\b|nc |ncat|python|perl|cmd\.exe|powershell)/i))
| parse regex field=_raw "(?<command_line>git rebase[^\n]+)" nodrop
| parse regex field=_raw "(?<parent_proc>gogs[^\s]*)" nodrop
| eval risk = if(command_line matches /--exec[= ]['"]?[^'"]*[;&|`$]/, "HIGH", "MEDIUM")
| count by _sourceHost, _sourceCategory, command_line, parent_proc, risk
| sort by risk, _count desc Sumo Logic query detecting git rebase --exec injection patterns and suspicious processes parented by Gogs across endpoint and OS log sources, with basic risk scoring.
Data Sources
Required Tables
False Positives & Tuning
- Developers on systems where Gogs is co-located running legitimate git rebase --exec for local branch maintenance
- Monitoring agents installed under the Gogs service user that initiate outbound connections
- Backup scripts run as the Gogs OS user that invoke wget or curl to retrieve configuration
Other platforms for CVE-2026-52806
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Simulate git rebase --exec argument injection via crafted PR branch name
Expected signal: Process creation event: git with args [rebase, --exec, id > /tmp/cve_rce_proof.txt, target]; child process creation: sh -c 'id > /tmp/cve_rce_proof.txt'; file creation event at /tmp/cve_rce_proof.txt
- Test 2Gogs suspicious child process simulation — reverse shell via curl
Expected signal: Process creation event showing bash or curl with parent process name 'gogs'; network connection attempt from gogs-named process to 127.0.0.1:9999
- Test 3Persistence via cron injection post-Gogs RCE simulation
Expected signal: Process creation: git rebase --exec with crontab modification command; crontab process invocation; file write to /tmp/cve_persist_marker.txt; audit log entry for crontab modification
Unlock Pro Content
Get the full detection package for CVE-2026-52806 including response playbook, investigation guide, and atomic red team tests.