CVE-2026-52804: Gogs privilege escalation in ChangeCollaborationAccessMode

CVE-2026-52804 · Severity: medium · CVSS 4 · Published 2026-06-24

Gogs is an open-source self-hosted Git service used by organizations to manage source code. A security flaw allows a user who has been granted administrative access to a specific repository to upgrade their own permissions to 'Owner' status. This allows the attacker to perform restricted actions such as deleting the repository, transferring ownership, or erasing wiki data, potentially leading to permanent data loss or unauthorized transfer of intellectual property.

Technologies: gogs.io/gogs (Go), Gogs. Vendors: Go, Gogs.

Quick answers

Is CVE-2026-52804 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-52804 being exploited in the wild.
How severe is CVE-2026-52804?
Medium severity, with a CVSS score of 4, published 24 June 2026.
Which products and versions are affected?
gogs.io/gogs (Go) < 0.14.3, SEMVER:introduced=0, SEMVER:introduced=0,fixed=0.14.3; Gogs < 0.14.3.
Is there a fix for CVE-2026-52804?
Yes. gogs.io/gogs (Go): upgrade to 0.14.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-52804 attacked?
It is attacked over the network, in a network appliance.
Am I affected by CVE-2026-52804?
Check whether you run gogs.io/gogs (Go) or Gogs at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • gogs.io/gogs (Go): upgrade to 0.14.3 or later
    go get gogs.io/gogs@v0.14.3

Technical details

An off-by-one error exists in the `ChangeCollaborationAccessMode` function within `internal/database/repo_collaboration.go`. The validation logic used a `mode > AccessModeOwner` check where `AccessModeOwner` is 4; because the check was not inclusive (>=), it allowed the value 4 to be processed. An attacker with existing 'Admin' collaborator privileges (AccessMode 3) can send a crafted POST request to the web UI settings endpoint with `mode=4` to gain full ownership of a repository. This allows for repository deletion and ownership transfer. The vulnerability is addressed in version 0.14.3 by tightening the validation to reject any mode greater than or equal to `AccessModeOwner`.

Affected products

  • Gogs Gogs < 0.14.3

Identifiers

  • CVE-2026-52804
  • GHSA-4565-r4x7-hg8j
  • GO-2026-5110

Timeline

  • 2026-04-05: other: Pull request submitted
  • 2026-06-07: patched: Version 0.14.3 released
  • 2026-06-19: advisory: GitHub Security Advisory published
  • 2026-06-24: disclosed: CVE published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.