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
RequireSigninViewsetting remains disabled (the default configuration) - The
/releases/attachmentsand/issues/attachmentsendpoints 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/attachmentsand/issues/attachmentson the Gogs server. - Required access: Network access to the Gogs web interface; no user account or login is needed when
RequireSigninViewis 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
RequireSigninViewor 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/attachmentsand/issues/attachmentscoming 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.

