What’s Vulnerable › Vulnerabilities
CVE-2021-32546
- Severity: high (CVSS 8.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 2.2% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-06-02 · updated 2026-06-17
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).
Affected products
- gogs: before 0.12.8 — fixed in 0.12.8
How to fix
Upgrade to a fixed version: gogs 0.12.8. Check the vendor advisory for mitigations.
References
- https://github.com/gogs/gogs/releases
- https://github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmx
- https://github.com/gogs/gogs/releases
- https://github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmx
Get alerted when CVE-2021-32546 or the next vulnerability affects your stack