# CVE-2021-32546: OS Command Injection in gogs

- Severity: High 8.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/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): 2.20%, higher than 83% of CVEs (2026-12-01)
- Published: 2022-05-31T21:21:18.000Z
- Modified: 2026-07-08T06:27:32.376Z
- Also known as: GHSA-56j7-2pm8-rgmx, GO-2022-0471
- Weaknesses: CWE-78
- Assigned by: mitre

## Description

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).

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- gogs.io/gogs (Go): before 0.12.8
- gogs gogs: before 0.12.8

## Every score

- GitHub: rating Critical
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 6.5 Medium `AV:N/AC:L/Au:S/C:P/I:P/A:P`

## References

- <https://github.com/gogs/gogs/releases> (release-notes, third-party-advisory, web)
- <https://github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmx> (advisory, issue-tracking, third-party-advisory, web)
- <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)

## Sources

- CVE List: [CVE-2021-32546](https://www.cve.org/CVERecord?id=CVE-2021-32546), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-56j7-2pm8-rgmx](https://github.com/advisories/GHSA-56j7-2pm8-rgmx), CC-BY-4.0, modified 2026-07-08
- Go Vulnerability Database: [GO-2022-0471](https://pkg.go.dev/vuln/GO-2022-0471), CC-BY-4.0, modified 2026-03-03
- NVD: [CVE-2021-32546](https://nvd.nist.gov/vuln/detail/CVE-2021-32546), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-32546 · Whole record: https://cve.day/CVE-2021-32546.json · Rebuilt by cve.day 2026-11-25T22:58:07.574Z
