Detect CVE-2026-52806: Gogs RCE via git rebase --exec Argument Injection in PR Merge in IBM QRadar
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
QRadar Detection Query
SELECT DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS event_time,
sourceip,
username,
"Command" AS command_line,
"Parent Process" AS parent_process,
QIDNAME(qid) AS event_name,
magnitude
FROM events
WHERE LOGSOURCETYPENAME(devicetype) IN ('Linux OS', 'Microsoft Windows Security Event Log', 'CrowdStrike Falcon')
AND (
("Command" ILIKE '%git%rebase%--exec%')
OR
("Parent Process" ILIKE '%gogs%' AND "Command" ILIKE ANY ('%curl%', '%wget%', '%bash%', '%sh %', '%nc %', '%python%', '%perl%', '%ncat%'))
)
AND LOGSOURCENAME(logsourceid) IS NOT NULL
LAST 24 HOURS AQL query for QRadar detecting git rebase --exec command injection patterns and suspicious child processes spawned from Gogs parent processes across Linux, Windows, and EDR log sources.
Data Sources
Required Tables
False Positives & Tuning
- Automated CI pipelines running git rebase --exec in controlled environments where Gogs hosts repositories
- Legitimate shell scripts initiated by the Gogs service for housekeeping tasks
- Security tooling performing authorized post-receive hook operations that spawn network utilities
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.