Command injectionin Gogs.
Proof of concept public (CISAThe US cyber defence agency. Its list names every hole it has seen used in real attacks. assessment).
A remote command execution vulnerability exists in gogs/gogs versions <=0.12.7 when deployed on a Windows server. The vulnerability arises due to improper validation of the `tree_path` parameter during file uploads. An attacker can set `tree_path=.git.` to upload a file into the .git directory, allowing them to write or rewrite the `.git/config` file. If the `core.sshCommand` is set, this can lead to remote command execution.
- Upgrade gogs.io/gogs (Go) to 0.12.8 or later.
Affected and fixed versions
From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.
From first report to first attacks
- 25 May 2022CVE ID reserved by @huntr_ai.
- 15 Nov 2024Published in the CVE List.
- 15 Nov 2024CVE record last updated.
Attack code anyone can find
Exploit maturity: Proof of concept (CISA assessment). CISA assessment (SSVC): exploitation poc.
Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.
Report a link
Nothing on this page links to exploit code right now. To report anything else, write to the contact point in the legal notice.
Other Gogs vulnerabilities
Same weakness: OS command injection
Patchminder. CVE-2022-1884: Command injection in Gogs. https://patchminder.com/cve/cve-2022-1884/ (accessed 5 December 2026).