CVE-2022-1884
CRITICAL 9.8CVSS 3.1OS Command Injection in gogs
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.
- Published
- 15 Nov 2024
- Last modified
- 17 Jun 2026
- Assigned by
- security@huntr.dev
- NVD status
- Analyzed
- Weakness
- CWE-77CWE-78
- Also known as
- GHSA-958j-443g-7mm7GO-2022-0749
- Sources
- NVDJSONOSV GHSA-958j-443g-7mm7JSONOSV GO-2022-0749JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary) | CVSS 3.1 | CRITICAL 10.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | security@huntr.dev (Secondary) | CVSS 3.0 | CRITICAL 10.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.0 | CRITICAL 10.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | gogs | gogscpe:2.3:a:gogs:gogs:*:*:*:*:*:*:*:* |
<= 0.12.7 | |
| OSV | Go | gogs.io/gogs | < 0.12.8 | 0.12.8 |
References
- https://huntr.com/bounties/9cd4e7b7-0979-4e5e-9a1c-388b58dea76b · Exploit, Third Party Advisory, WEB
- https://github.com/gogs/gogs/security/advisories/GHSA-958j-443g-7mm7 · WEB, ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2022-1884 · ADVISORY
- https://github.com/gogs/gogs/issues/6968 · WEB
- https://github.com/gogs/gogs/pull/6970 · WEB
- https://github.com/gogs/gogs · PACKAGE
- https://github.com/gogs/gogs/blob/f36eeedbf89328ee70cc3a2e239f6314f9021f58/conf/app.ini#L127-L129 · WEB
- https://github.com/gogs/gogs/releases/tag/v0.12.8 · WEB
- https://www.huntr.dev/bounties/9cd4e7b7-0979-4e5e-9a1c-388b58dea76b · WEB
History
- 25 Nov 2026 20:56 UTC · NVD: first stored (published 15 Nov 2024)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 21 Aug 2024)
- 25 Nov 2026 20:13 UTC · OSV: first stored (published 2 Jun 2022)