/

CVE-2026-52800

Severity:

HIGH RISK

(8.8)

CSRF (CWE-352) in Gogs Org Team Member Management

CVE-2026-52800

Deferred

Vulnerability type

Category:

Cross-Site Request Forgery

CWE:

CWE-352

Impact:

Privilege Escalation

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A cross-site request forgery vulnerability in Gogs allows organization team member management actions to be triggered via GET requests without CSRF protection.

If an organization owner is logged in and visits a crafted link, an attacker-controlled account can be added to the Owners team, granting organization owner–equivalent privileges.

Affected context

This vulnerability occurs in Gogs instances where organization team member management endpoints accept state-changing GET requests without CSRF defenses.

It becomes relevant when organization owners are authenticated in their browser and can be induced to load attacker-controlled URLs (e.g., through links in emails, chat messages, or embedded content).

Exploit preconditions

  • Attack surface: Web interface endpoints responsible for organization team member management.
  • Required access: Ability to cause a logged-in organization owner to load a crafted URL (no direct access to the admin UI needed).
  • Trigger point: Victim's browser performs a GET request to the vulnerable endpoint while the victim is authenticated.
  • Why exploitation is possible: State-changing actions lack CSRF tokens and rely only on session cookies, allowing cross-origin requests to succeed with the victim's privileges.

Why this happens

The underlying issue is a design flaw where sensitive, state-changing operations (managing organization team members) are exposed via GET requests and do not enforce cross-site request forgery protections.

In terms of CWE-352, the application trusts any request carrying valid session cookies, without requiring an unguessable, user-specific token or other CSRF mitigations.

This insecure pattern allows an attacker to cause the victim's browser to perform unintended privileged actions simply by embedding or redirecting to the target URL.

Potential impact

  • An attacker-controlled account may be added to the Owners team of an organization.
  • Attackers could gain organization owner–equivalent privileges over repositories and settings.
  • They can modify repository configurations, permissions, and hooks.
  • They may delete or transfer repositories owned by the affected organization.
  • They could create or alter access tokens and integrations associated with the organization.

General mitigation guidance

Effective mitigation focuses on ensuring that all state-changing operations require robust CSRF defenses and cannot be triggered with simple GET requests.

Recommended patterns include:

  • Restricting sensitive operations (such as membership changes) to POST/PUT/DELETE requests with proper CSRF token validation.
  • Using framework-level CSRF middleware that enforces tokens on all authenticated, state-changing endpoints by default.
  • Applying the principle of least privilege to team management features to limit the blast radius of compromised accounts.
  • Reviewing UI patterns to avoid actions that can be executed via bookmarkable or embeddable links without additional verification.

How teams detect issues like this

Detection typically involves a combination of code-level and behavioral review:

  • Static analysis or manual review to identify state-changing endpoints implemented with GET methods or lacking CSRF token checks.
  • Policy-based enforcement that all authenticated actions modifying server-side state must include CSRF validation.
  • Integration tests or security testing that exercise cross-origin requests to sensitive endpoints to confirm rejection without valid CSRF tokens.
  • Periodic review of route definitions and controller handlers to verify that privilege-sensitive operations follow secure HTTP method and CSRF patterns.

Sources

SourceLink
github.comgithub.com/gogs/gogs/commit/070df61ecd14c75b0aca93090f860b87ab17ac19
github.comgithub.com/gogs/gogs/pull/8321
github.comgithub.com/gogs/gogs/releases/tag/v0.14.3
github.comgithub.com/gogs/gogs/security/advisories/GHSA-pwx3-qcgw-vh7h

Frequently asked

questions

Yes. An attacker can host a crafted page or send a malicious link; if a logged-in organization owner visits it, their browser can perform the unwanted team management action.

The attacker does not need direct access to the Gogs instance. They only need to ensure that a legitimate organization owner is authenticated and visits the attacker-controlled URL.

Require state-changing operations to use non-idempotent HTTP methods (POST/PUT/DELETE) and enforce CSRF token validation on all such endpoints, ideally via centralized middleware.

Adopt a secure-by-default framework for request handling, maintain a checklist that all authenticated, state-changing routes must include CSRF protection, and regularly review route definitions and UI flows for unintended GET-triggered actions.

Find out what's already
exploitable in your codebase.