CVE-2021-32546
mediumpriority · track · 36EPSS 0.022 · 82 %ileEUUSEPSS · scored 2026-10-23
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).
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 6.5–8.8
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (3)
Products and version ranges known to be affected.
advisories (2)
Vendor and ecosystem advisories describing this.
- GHSA-56j7-2pm8-rgmxOS Command Injection in gogs2022-06-02ghsa · osvUS
### Impact The malicious user is able to update a crafted `config` file into repository's `.git` directory with to gain SSH access to the server. All installations with [repository upload enabled (default)](https://github.com/gogs/gogs/blob/f36eeedbf89328ee70cc3a2e239f6314f9021f58/conf/app.ini#L127-L129) are affected. ### Patches Repository file updates are prohibited to its `.git` directory. Users should upgrade to 0.12.8 or the latest 0.13.0+dev. ### Workarounds N/A ### References N/A ### For more information If you have any questions or comments about this advisory, please post on #6555.
- GO-2022-0471OS Command Injection in gogs in gogs.io/gogs2024-08-21vendor · osvUS
OS Command Injection in gogs in gogs.io/gogs
also known as (5)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (7)
External citations — patches, advisories, analysis.
- https://cxsecurity.com/cveshow/CVE-2021-32546/cnnvd
- https://github.com/gogs/gogs/releasescnnvd
- https://github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmxcnnvd
- https://github.com/gogs/gogs/releasesenisa_euvd
- https://github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmxenisa_euvd
- https://github.com/gogs/gogs/releasesRelease NotesThird Party Advisorynvd
- https://github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmxIssue TrackingThird Party Advisorynvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan