RCE in Gogs

CVE-2022-1884

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.

Vulnerability class: Command Injection (OS Command Injection)

Published · last modified .

CVSS v3 metric

CVSS v3 base score 9.8 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.

EPSS exploit prediction

EPSS: 0.018 (78.1th percentile), scored .

Low probability of exploitation in the next 30 days, but still tracked. 78th percentile — 78.1% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.

EPSS trend (30 days)EPSS over the last 30 days for CVE-2022-1884: held from 0.018 to 0.018.

EPSS over last 30 days · oldest: 0.018 · newest: 0.018 · change: 0.000

Affected products

Weakness classification (CWE)

Public proof-of-concept exploits

References

Frequently asked questions

What is CVE-2022-1884?
CVE-2022-1884 is a critical-severity vulnerability in Gogs, classified under OS Command Injection. CVSS score: 9.8/10. Published 2024-11-15.
How severe is CVE-2022-1884?
Critical severity. CVSS v3 base score is 9.8 out of 10.
Is CVE-2022-1884 known to be exploited?
2 public proof-of-concept repositories are indexed. Not currently listed in the CISA KEV catalog.