Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. gogs.io/gogs
  4. ›
  5. CVE-2021-32546

CVE-2021-32546: OS Command Injection in gogs

June 2, 2022 (updated June 3, 2022)

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

References

  • github.com/advisories/GHSA-56j7-2pm8-rgmx
  • github.com/gogs/gogs/blob/f36eeedbf89328ee70cc3a2e239f6314f9021f58/conf/app.ini
  • github.com/gogs/gogs/issues/6555
  • github.com/gogs/gogs/pull/6986
  • github.com/gogs/gogs/releases
  • github.com/gogs/gogs/releases/tag/v0.12.8
  • github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmx
  • nvd.nist.gov/vuln/detail/CVE-2021-32546

Code Behaviors & Features

Detect and mitigate CVE-2021-32546 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.12.8

Fixed versions

  • 0.12.8

Solution

Upgrade to version 0.12.8 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Source file

go/gogs.io/gogs/CVE-2021-32546.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:31 +0000.