CVE-2022-1884Gogs
Critical 9.8 No auth needed
Follow: this CVE · Gogs · Gogs We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- 2.2% probability of exploitation in 30 days · percentile 83
- Auth required
- No
- Published
- Nov 15, 2024
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: yes · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
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
- Apply the vendor's security update for Gogs.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Go | gogs.io/gogs |
< 0.12.8 |
0.12.8 |
go get gogs.io/gogs@v0.12.8 |
| Go | gogs.io/gogs |
< 0.12.8 |
0.12.8 |
go get gogs.io/gogs@v0.12.8 |
Per OSV / GitHub Advisories (GHSA-958j-443g-7mm7, GO-2022-0749). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| gogs | gogs | ≤ 0.12.7 |
Official sources
References
Links published by the sources. Open them with care.
- huntr.com Exploit Third Party Advisory