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

CVE-2026-52797: Gogs: Overwriting critical files results in a denial of service

June 16, 2026

Vulnerability type: Path Traversal Impact: DoS Exploitation prerequisite: authorized user Description: As an authorized user, an intruder can dictate the value which is passed to the git diff command which, together with bypassing the filtering of the passed value, allows the user to bypass the target directory and write the result of the comparison to any arbitrary path. Researcher: Artyom Kulakov (Positive Technologies) Mitigation:

  1. https://github.com/gogs/gogs/blob/b7372b1f32cd0bb40984debfb049e3fc04efaee4/internal/route/repo/editor.go#L307 — on this line, instead of the treePath variable, which comes directly from the user unchanged, we should first filter and then pass the entry variable.
  2. To filter the treePath variable, it is better to use the preexisting pathutil.Clean function instead of path.Clean from the standard Go library.

References

  • github.com/advisories/GHSA-pm6v-2h4w-4rp2
  • github.com/gogs/gogs/security/advisories/GHSA-pm6v-2h4w-4rp2
  • nvd.nist.gov/vuln/detail/CVE-2026-52797

Code Behaviors & Features

Detect and mitigate CVE-2026-52797 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.14.0

Fixed versions

  • 0.14.0

Solution

Upgrade to version 0.14.0 or above.

Impact 8.5 HIGH

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

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

go/gogs.io/gogs/CVE-2026-52797.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Tue, 23 Jun 2026 12:22:56 +0000.