Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-32546

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

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-32546
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:46 UTC · Revision 1

Source evidence

CVE-2021-32546

core-osv · Original source

Published 2 Jun 2022, 14:15 UTC

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

osv:CVE-2021-32546
Complete source record
{
  "id": "63d349f96571f017976f1183def33e40e13fcfe4f89b5ab7ff9374ff7c3e2557",
  "url": "https://osv.dev/vulnerability/CVE-2021-32546",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-32546",
    "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).",
    "evidence": "osv:CVE-2021-32546",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-32546",
      "aliases": [
        "CVE-2021-32546",
        "GHSA-56j7-2pm8-rgmx",
        "GO-2022-0471"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/gogs/gogs",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "7f8799c01f264eb7770766621fb68debee414b68"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:gogs:gogs:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.12.8"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.12.7-rc.1",
            "v0.12.7",
            "v0.12.6-rc.1",
            "v0.12.6",
            "v0.12.5-rc.1",
            "v0.12.5",
            "v0.12.4-rc.1",
            "v0.12.4",
            "v0.12.3",
            "v0.12.2",
            "v0.12.1",
            "v0.12.0",
            "v0.11.91",
            "v0.11.86",
            "v0.11.79",
            "v0.11.66",
            "v0.11.53",
            "v0.11.43",
            "v0.11.34",
            "v0.11.33",
            "v0.11.29",
            "v0.11.19",
            "v0.11.4",
            "v0.11",
            "v0.11rc",
            "v0.10.18",
            "v0.10.8",
            "v0.10",
            "v0.10rc",
            "v0.9.141",
            "v0.9.128",
            "v0.9.113",
            "v0.9.97",
            "v0.9.71",
            "v0.9.60",
            "v0.9.48",
            "v0.9.46",
            "v0.9.13",
            "v0.9.0",
            "v0.8.43",
            "v0.8.25",
            "v0.8.10",
            "v0.8.0",
            "v0.7.33",
            "v0.7.22",
            "v0.7.19",
            "v0.7.6",
            "v0.7.0",
            "v0.6.15",
            "v0.6.9",
            "v0.6.3",
            "v0.6.1",
            "v0.5.13",
            "v0.5.11",
            "v0.5.9",
            "v0.5.8",
            "v0.5.5",
            "v0.5.2",
            "v0.5.0",
            "v0.4.2",
            "v0.4.1",
            "v0.4.0",
            "v0.3.1",
            "v0.3.0",
            "v0.2.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-32546.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:41.648441795Z",
      "provider": "osv",
      "references": [
        "https://github.com/gogs/gogs/releases",
        "https://github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmx"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-32546",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 385905,
  "published_at": "2022-06-02T14:15:28.587+00:00"
}