# CVE-2022-1884: Remote Command Execution in gogs/gogs

- Severity: Critical 10.0 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.82%, higher than 79% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-06-02T20:50:21.000Z
- Modified: 2026-06-17T04:23:16.700Z
- Also known as: GHSA-958j-443g-7mm7, GO-2022-0749
- Weaknesses: CWE-77, CWE-78
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: @huntr_ai

## Description

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.

(As written by CVE List.)

## Affected

- gogs gogs/gogs: from unspecified up to latest
- gogs gogs: up to 0.12.7
- gogs.io/gogs (Go): before 0.12.8

## Every score

- @huntr_ai: CVSS:3.0 10.0 Critical `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- CISA-ADP: CVSS:3.1 10.0 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- GitHub: CVSS:3.0 10.0 Critical `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## 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> (advisory, web)
- <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)

## Sources

- CVE List: [CVE-2022-1884](https://www.cve.org/CVERecord?id=CVE-2022-1884), CVE Terms of Use, modified 2024-11-15
- GitHub Advisory Database: [GHSA-958j-443g-7mm7](https://github.com/advisories/GHSA-958j-443g-7mm7), CC-BY-4.0, modified 2024-11-15
- Go Vulnerability Database: [GO-2022-0749](https://pkg.go.dev/vuln/GO-2022-0749), CC-BY-4.0, modified 2026-03-03
- NVD: [CVE-2022-1884](https://nvd.nist.gov/vuln/detail/CVE-2022-1884), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-1884 · Whole record: https://cve.day/CVE-2022-1884.json · Rebuilt by cve.day 2026-11-25T22:58:20.051Z
