Vulnerabilities · 2022 · Gogs
CVE-2022-1884
Gogs vulnerability
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.
High priority: this vulnerability is rated critical and can be attacked over the network without a login.
Affected products
Gogs. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Gogs runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Limit access until thenIf you cannot update at once, take the system off the internet or restrict who can reach it.
References
- huntr.com/bounties/9cd4e7b7-0979-4e5e-9a1c-388b58dea76b · Exploit
- github.com/gogs/gogs/security/advisories/GHSA-958j-443g-7mm7
- github.com/gogs/gogs/issues/6968
- github.com/gogs/gogs/pull/6970
- github.com/gogs/gogs/blob/f36eeedbf89328ee70cc3a2e239f6314f9021f58/conf/app.ini#L127-L129
- github.com/gogs/gogs/releases/tag/v0.12.8
- nvd.nist.gov/vuln/detail/CVE-2022-1884
- www.huntr.dev/bounties/9cd4e7b7-0979-4e5e-9a1c-388b58dea76b
- nvd.nist.gov/vuln/detail/CVE-2022-1884
- cve.org/CVERecord?id=CVE-2022-1884
More vulnerabilities in Gogs products
CVE-2026-26276CVE-2026-26196CVE-2025-8110CVE-2024-56731CVE-2024-55947CVE-2024-54148CVE-2024-44625CVE-2024-39933All 35
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.