All vulnerabilities

Servers and applications

CVE-2022-1884

OS Command Injection in file uploading

Severity
Critical 9.8
Published
31 May 2022
Last changed
17 Jun 2026
Added to UpHeron
1 Nov 2026
Fixed in
0.12.8
Also known as
GHSA-958j-443g-7mm7
Sources
NVD, Project advisories (GitHub)

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…

Affected software

SoftwareAffected versions
GogsServers and applications · cpe:a:gogs:gogs
  • Every version up to 0.12.7
GogsServers and applications · github:gogs/gogs
  • Every version before 0.12.8

References

  • NVD https://nvd.nist.gov/vuln/detail/CVE-2022-1884
  • CVE.org https://www.cve.org/CVERecord?id=CVE-2022-1884
  • GitHub Advisory Database https://github.com/advisories/GHSA-958j-443g-7mm7
  • github.com https://github.com/gogs/gogs/security/advisories/GHSA-958j-443g-7mm7