Live threats

All CVEs / Gogs

CVE-2022-1884Gogs

Critical 9.8 No auth needed

Priority
74
CVSS 3.1
9.8
EPSS
2.2%
probability of exploitation in 30 days · percentile 83
Auth required
No
Published
Nov 15, 2024
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-78, CWE-77
SSVC (CISA)
Exploitation: proof of concept · Automatable: yes · Technical impact: total
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

What happens

A remote command execution vulnerability exists in gogs/gogs versions <=0.12.7 when deployed on a Windows server. The vulnerability arises due to improper validation of the `tree_path` parameter during file uploads. An attacker can set `tree_path=.git.` to upload a file into the .git directory, allowing them to write or rewrite the `.git/config` file. If the `core.sshCommand` is set, this can lead to remote command execution.

Original NVD text.

What to do

  1. Apply the vendor's security update for Gogs.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
Go gogs.io/gogs < 0.12.8 0.12.8 go get gogs.io/gogs@v0.12.8
Go gogs.io/gogs < 0.12.8 0.12.8 go get gogs.io/gogs@v0.12.8

Per OSV / GitHub Advisories (GHSA-958j-443g-7mm7, GO-2022-0749). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
gogsgogs≤ 0.12.7

Official sources

References

Links published by the sources. Open them with care.