CVE-2021-32546
HIGH 8.8CVSS 3.1OS Command Injection in gogs
Missing input validation in internal/db/repo_editor.go in Gogs before 0.12.8 allows an attacker to execute code remotely. An unprivileged attacker (registered user) can overwrite the Git configuration in his repository. This leads to Remote Command Execution, because that configuration can contain an option such as sshCommand, which is executed when a master branch is a remote branch (using an ssh:// URI). The remote branch can also be configured by editing the Git configuration file. One can create a new file in a new repository, using the GUI, with "" as its name, and then rename this file to .git/config with the custom configuration content (and then save it).
- Published
- 2 Jun 2022
- Last modified
- 8 Jul 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-78
- Also known as
- GHSA-56j7-2pm8-rgmxGO-2022-0471
- Sources
- NVDJSONOSV GHSA-56j7-2pm8-rgmxJSONOSV GO-2022-0471JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 6.5 | AV:N/AC:L/Au:S/C:P/I:P/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | gogs | gogscpe:2.3:a:gogs:gogs:*:*:*:*:*:*:*:* |
< 0.12.8 | 0.12.8 |
| OSV | Go | gogs.io/gogs | < 0.12.8 | 0.12.8 |
References
- https://github.com/gogs/gogs/releases · Release Notes, Third Party Advisory, WEB
- https://github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmx · Issue Tracking, Third Party Advisory, WEB, ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2021-32546 · ADVISORY
- https://github.com/gogs/gogs/issues/6555 · WEB
- https://github.com/gogs/gogs/pull/6986 · 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
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 2 Jun 2022)
- 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)