CVE-2021-32546 json
OS Command Injection in gogs
published 2022-05-31 4 y ago modified 2026-07-08 4 mo ago also GHSA-56j7-2pm8-rgmx , GO-2022-0471 , EUVD-2022-5932
- cvss
- 8.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.2%
- EPSS 2.2% chance of exploitation in 30 days, percentile 82%
- public exploits
- 0
- none known
Summary
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).
Patch / fix
- go gogs.io/gogs 0.12.8
- gogs gogs 0.12.8
- github.com/gogs/gogs#6986 pull request
- github.com/gogs/gogs/releases/tag/v0.12.8 release
Exploit prediction
2.20% chance of exploitation in the next 30 days, higher than 82% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.5 | AV:N/AC:L/Au:S/C:P/I:P/A:P |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| go | gogs.io/gogs | <0.12.8 |
0.12.8 |
Classification
- Weakness
-
- CWE-78 Improper Neutralization of Special Elements used in an OS Command
References
-
github.com
/gogs/gogs/pull/6986
web
-
github.com
/gogs/gogs/releases
web, release-notes, third-party-advisory
-
github.com
/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmx
web, issue-tracking, third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-32546
advisory
-
github.com
/gogs/gogs/issues/6555
web
-
github.com
/gogs/gogs
package
-
github.com
/gogs/gogs/blob/f36eeedbf89328ee70cc3a2e239f6314f9021f58/conf/app.ini#L127-L129
web
-
github.com
/gogs/gogs/releases/tag/v0.12.8
web
Sources
- CVE List CVE-2021-32546
- GitHub Advisory GHSA-56j7-2pm8-rgmx
- NVD CVE-2021-32546
- OSV GO-2022-0471
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.