Categories
CVE-2021-32546

OS Command Injection in gogs.io/gogs (CVE-2021-32546)

Summary

OS command injection in gogs.io/gogs (CVE-2021-32546). Successful exploitation can lead to full system takeover. Mitigation: upgrade to 0.12.8 or later.

Original description

The description as published by the source.

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

Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2021-32546 has been found in gogs.io/gogs.
Successful exploitation can lead to full system takeover.
What to do: upgrade gogs.io/gogs to 0.12.8 or later.
If unsure, ask your IT team or search "gogs.io/gogs CVE-2021-32546" on the vendor's site.

CVE-2021-32546 (gogs.io/gogs) — CWE-78
Attack vector: remote (network-reachable) / no user interaction
Patched: 0.12.8 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

OS command injection (CWE-78) exists in gogs.io/gogs.

📍 Affected scope

Check the vendor advisory for the affected versions of gogs.io/gogs.

🔥 Severity

Severity: ?. Successful exploitation can lead to full system takeover.

🔧 How to fix

Update to 0.12.8.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'gogs.io/gogs' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'gogs.io/gogs' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で gogs.io/gogs を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade gogs.io/gogs to 0.12.8

    ステージング環境で 0.12.8 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

Go gogs.io/gogs
[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.12.8"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details