CVE-2026-25242: Gogs allows unauthenticated file uploads

Published Feb 17, 2026
·
Updated

Gogs is an open source self-hosted Git service. Versions 0.13.4 and below expose unauthenticated file upload endpoints by default. When the global RequireSigninView setting is disabled (default), any remote user can upload arbitrary files to the server via /releases/attachments and /issues/attachments. This enables the instance to be abused as a public file host, potentially leading to disk exhaustion, content hosting, or delivery of malware. CSRF tokens do not mitigate this attack due to same-origin cookie issuance. This issue has been fixed in version 0.14.1.

Other sources

Security Advisory:Unauthenticated File Upload in Gogs Vulnerability Type: Unauthenticated File Upload Date: Aug 5, 2025 Discoverer: OpenAI Security Research

Summary Gogs exposes unauthenticated file upload endpoints by default. When the global RequireSigninView setting is disabled (default), any remote user can upload arbitrary files to the server via /releases/attachments and /issues/attachments. This enables the instance to be abused as a public file host, potentially leading to disk exhaustion, content hosting, or delivery of malware. CSRF tokens do not mitigate this attack due to same-origin cookie issuance.

Affected Versions

- Software: Gogs - Confirmed Version(s): 28f83626d4ed0aa7b89493be2ea8b79ca038331e - Likely Affected: All versions since 2020-04-05 with unauthenticated attachments endpoints - Introduced Commit: 07818d5fa

Vulnerability Details The web.go router exposes the following endpoints under the ignSignIn route group:

Vulnerable Code Snippet m.Post("/issues/attachments", repo.UploadIssueAttachment) m.Post("/releases/attachments", repo.UploadReleaseAttachment) These endpoints are accessible by unauthenticated users if the configuration variable RequireSigninView is false (default). This allows arbitrary file uploads to data/attachments, returning a UUID in response.

While CSRF protection is enabled, attackers can obtain a valid token anonymously from the site and use it in the upload request without authentication. Description Anonymous file upload using only default configuration and a CSRF token obtained from the homepage. POC Run Gogs docker docker start gogs

Software will be run on http://localhost:10880/. Finish the setup with local Sqlite database

Get CSRF cookie into a jar curl -sS -c cookies.txt http://localhost:10880/ -o /dev/null

Extract the csrf value from the jar CSRF="$(awk '$6=="csrf"{print $7}' cookies.txt | tail -n1)"

Upload the file, sending cookie jar + header curl -sS \ -b cookies.txt -c cookies.txt \ -H "X-CSRF-Token: $CSRF" \ -H "Referer: http://localhost:10880/" \ -F "file=@image.png" \ http://localhost:10880/issues/attachments

=> {"uuid":"<UUID>"} The attachment will be available at: http://localhost:10880/attachments/<uuid>

Impact Unrestricted File Upload: Attackers can store arbitrary content on the server. Denial-of-Service: Repeated uploads can exhaust disk space. Malware Hosting: Gogs may inadvertently serve attacker-hosted payloads under its domain.

Realistic Exploitation Scenarios

- Spammers or malicious actors use the Gogs instance to host phishing payloads or malware. - Attackers fill up disk with repeated uploads. - Attackers use hosted Gogs instances as public file dumps (e.g., for P2P, exfiltration)

Potential Impact This unauthenticated upload vector effectively turns any Gogs instance into a file hosting platform open to the public. This is especially dangerous for production or Internet-exposed installations. The combination of no login requirement, wildcard MIME support, and unrestricted access to attachments enables both resource abuse and potential malware distribution.

Timeline

- August 2025: Discovered via GPT5 - August 2025: Reproduced and confirmed via PoC and sanitizer - Aug 6, 2025 - Sent to Gogs via https://github.com/gogs/gogs/security/advisories/new

GitHub

Affected Software

2 affected componentsFixes available
go/gogs.io/gogs<0.14.1
0.14.1
Gogs Gogs<0.14.1

Event History

Feb 17, 2026
Advisory Published
via GitHub·06:44 PM
Data Sourced
via GitHub·06:44 PM
DescriptionWeaknessAffected Software
Feb 19, 2026
CVE Published
via MITRE·02:28 AM
Data Sourced
via MITRE·02:28 AM
DescriptionWeakness
Data Sourced
via NVD·07:17 AM
RemedyDescriptionSeverityWeaknessAffected Software
Aug 19, 58109
Event
via FIRST·07:22 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-25242?

CVE-2026-25242 is classified as a critical vulnerability due to the risk of arbitrary file uploads by unauthenticated users.

2

How do I fix CVE-2026-25242?

To fix CVE-2026-25242, update Gogs to version 0.14.1 or later and ensure the 'RequireSigninView' setting is enabled.

3

Which versions of Gogs are affected by CVE-2026-25242?

CVE-2026-25242 affects Gogs versions 0.13.4 and below.

4

What can attackers do with CVE-2026-25242?

Attackers can upload arbitrary files to the server, potentially leading to code execution or data breaches.

5

Is there a way to mitigate CVE-2026-25242 without upgrading?

Yes, you can mitigate CVE-2026-25242 by enabling the 'RequireSigninView' setting to restrict file uploads to authenticated users.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203