patchminder
Proof of concept · CISA assessment CVE-2022-1884

Command injectionin Gogs.

Published 15 Nov 2024 · Updated 15 Nov 2024 · Every fact sourced

JSONCite
Is it exploited?
Not confirmed

Proof of concept public (CISAThe US cyber defence agency. Its list names every hole it has seen used in real attacks. assessment).

Severity
Critical 10.0
CVSSA severity score from 0 to 10. 9 and higher is critical. 3.0 · no login needed
Attack likelihood
Moderate
EPSSA daily score from FIRST: the chance a hole is attacked in the next 30 days. 1.8% chance in 30 days · 4 Dec 2026
Fix
Available
Upgrade to 0.12.8 or later
In plain words

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.

What to do now
  • Upgrade gogs.io/gogs (Go) to 0.12.8 or later.
Versions

Affected and fixed versions

Product or package
Affected
Fixed in
Source
gogs/gogs
Not confirmed
Not confirmed
CVE record
gogs
0.12.7 and earlier
Not confirmed
CISA
gogs.io/gogs (Go)
before 0.12.8
0.12.8
GitHub advisory

From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.

Timeline

From first report to first attacks

  1. 25 May 2022
    CVE ID reserved by @huntr_ai.
  2. 15 Nov 2024
    Published in the CVE List.
  3. 15 Nov 2024
    CVE record last updated.
Exploit code

Attack code anyone can find

Exploit maturity: Proof of concept (CISA assessment). CISA assessment (SSVC): exploitation poc.

Metasploit module
None known
Nuclei scan template
None known
Exploit-DB
None known
GitHub proof of concepts
None known

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.

Related

Other Gogs vulnerabilities

Same weakness: OS command injection

All CWE-78 vulnerabilities

References
Cite this page

Patchminder. CVE-2022-1884: Command injection in Gogs. https://patchminder.com/cve/cve-2022-1884/ (accessed 5 December 2026).