/

CVE-2026-25242

Severity:

CRITICAL RISK

(9.8)

Missing Authorization in Gogs Git Service

CVE-2026-25242

Analyzed

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Abuse of file storage for untrusted or malicious content, including potential disk exhaustion and malware hosting

Severity:

CRITICAL RISK

(9.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

Gogs versions 0.13.4 and below expose file upload endpoints that can be accessed without authentication when the global RequireSigninView setting is disabled (the default).

Any remote user can upload arbitrary files via the releases and issues attachment endpoints, allowing abuse of the instance as a public file host, which may lead to disk exhaustion, unwanted content hosting, or malware distribution.

Affected context

The vulnerability occurs in Gogs deployments where:

  • The instance is reachable over the network (e.g., internet- or intranet-exposed)
  • The global RequireSigninView setting remains disabled (the default configuration)
  • The /releases/attachments and /issues/attachments endpoints are enabled and in use

In this configuration, upload functionality is available even to unauthenticated users, and authorization checks are not enforced at these endpoints.

Exploit preconditions

  • Attack surface: HTTP(S) endpoints /releases/attachments and /issues/attachments on the Gogs server.
  • Required access: Network access to the Gogs web interface; no user account or login is needed when RequireSigninView is disabled.
  • Trigger point: Sending an HTTP request that submits a file upload to the exposed attachment endpoints.
  • Why exploitation is possible: The upload handlers fail to enforce authorization, relying solely on a global sign-in requirement that is disabled by default. As a result, they treat unauthenticated requests as permitted actions, and CSRF protections are ineffective because cookies are issued on the same origin.

Why this happens

The underlying issue is a lack of explicit authorization checks on sensitive file upload endpoints.

Instead of validating that the requester is an authenticated and authorized user before accepting uploads, the implementation assumes that the global RequireSigninView setting provides sufficient access control.

With this setting disabled by default, the upload handlers effectively become public APIs, mapping to CWE-862: Missing Authorization, where an application performs a security-sensitive operation without confirming the user's permissions.

Potential impact

  • The server may be used as an unregulated public file hosting service.
  • Attackers could upload large volumes of data, potentially leading to disk space exhaustion and service disruption.
  • The instance can host or distribute malware, phishing pages, or illegal content, exposing operators to legal and reputational risk.
  • Increased bandwidth consumption and resource usage due to uncontrolled file transfers.
  • Indirect facilitation of further attacks if malicious content is shared from a trusted Gogs domain.

General mitigation guidance

Effective mitigation focuses on enforcing strong authorization at all file upload boundaries and reducing trust in default configurations:

  • Require authentication and appropriate permissions for all upload endpoints, regardless of global view settings.
  • Treat file-upload handlers as high-risk operations and ensure they always perform explicit access control checks.
  • Use secure-by-default configurations that do not expose write actions to unauthenticated users.
  • Limit the maximum size and total quota for uploaded content per user or repository to reduce resource exhaustion risk.
  • Apply defense-in-depth controls such as web server or reverse proxy rules that restrict access to upload endpoints where appropriate.
  • Where file hosting is not needed, consider disabling or tightly limiting attachment features.

How teams detect issues like this

Detection can rely on both code-centric and operational signals:

  • Static analysis and code review:
  • Look for HTTP handlers that accept file uploads without explicit authorization checks.
  • Flag controllers that rely solely on global configuration flags for access control instead of per-endpoint enforcement.
  • Review routes that modify server state (e.g., uploads, deletions) and verify that they require authenticated sessions.
  • Configuration and policy checks:
  • Monitor deployments for RequireSigninView or similar settings that, when disabled, still leave sensitive operations available.
  • Enforce policy that all write endpoints be authenticated and authorized, validated via automated configuration linting.
  • Runtime and logging:
  • Analyze access logs for large volumes of requests to /releases/attachments and /issues/attachments coming from unauthenticated or unknown sources.
  • Set alerts on anomalous spikes in file upload traffic or disk usage indicative of abuse.
  • Automated security testing tools and web application scanners can help identify state-changing endpoints accessible without authentication.

Sources

SourceLink
github.comgithub.com/gogs/gogs/commit/628216d5889fcb838c471f4754f09b935d9cd9f3
github.comgithub.com/gogs/gogs/pull/8128
github.comgithub.com/gogs/gogs/releases/tag/v0.14.1
github.comgithub.com/gogs/gogs/security/advisories/GHSA-fc3h-92p8-h36f

Frequently asked

questions

Yes. As long as the Gogs instance is reachable over the network and RequireSigninView is disabled, any remote user can send upload requests to the affected endpoints without logging in.

No user account or special privileges are required in the vulnerable configuration. Network access to the Gogs web interface is sufficient to upload arbitrary files.

The safest pattern is to enforce explicit authorization checks on all file upload endpoints so that only authenticated and properly authorized users can upload. Complement this with secure-by-default settings that do not expose write actions to unauthenticated users and with quotas and limits on uploads.

Adopt a design principle where every state-changing or resource-consuming operation (such as file uploads) requires explicit authentication and authorization, independent of global view settings. Combine this with systematic security reviews, automated checks for unauthenticated write endpoints, conservative defaults, and clear separation between read-only and write-capable routes.

Find out what's already
exploitable in your codebase.