CVE-2026-25242: Gogs.io/gogs Unauthenticated File Upload Vulnerability

MODERATE
Advisory Identifier: GHSA-fc3h-92p8-h36f
CWE-862
Published
Advisory Summary

CVE-2026-25242 is a MODERATE unauthenticated file upload vulnerability (CWE-862: Missing Authorization) affecting Gogs.io/gogs libraries in the Go ecosystem. The issue involves unauthenticated file upload in gogs. Remediation is available by upgrading affected packages to version 0.14.1.

CVE-2026-25242 at a Glance

CVE Identifier CVE-2026-25242
GHSA Identifier GHSA-fc3h-92p8-h36f
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-862: Missing Authorization
Affected Product Gogs.io/gogs
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-25242

To remediate this vulnerability, upgrade all affected Gogs.io/gogs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gogs.io/gogs fixed: 0.14.1
Upgrade gogs.io/gogs to 0.14.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for gogs.io/gogs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-25242, inspect your project dependencies for Gogs.io/gogs:

inspect dependencies for gogs.io/gogs

Analyze the terminal output to locate any version of Gogs.io/gogs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.14.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In Gogs.io/gogs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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](https://github.com/gogs/gogs/tree/main) - 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

CVE-2026-25242 Affected Gogs.io/gogs Versions

1 component(s)
Fixed Versions:
0.14.1
Product / Package Ecosystem Affected Versions Fixed Version
gogs.io/gogs
Go
< 0.14.1
0.14.1

References

Frequently Asked Questions

What is CVE-2026-25242?
CVE-2026-25242 is a security vulnerability in Gogs.io/gogs involving Unauthenticated File Upload in Gogs under CWE-862: Missing Authorization.
Which Gogs.io/gogs versions are affected?
Affected versions include releases prior to 0.14.1 across affected packages: gogs.io/gogs.
What version fixes CVE-2026-25242?
Upgrading to 0.14.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gogs.io/gogs affected?
Yes, gogs.io/gogs is affected in releases prior to 0.14.1. Upgrade your dependency to 0.14.1 or later.
What CWE is associated with CVE-2026-25242?
CVE-2026-25242 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Go dependencies for CVE-2026-25242?
Run the dependency tree command: 'inspect dependencies for gogs.io/gogs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fc3h-92p8-h36f",
  "modified" : "2026-02-19T21:23:40Z",
  "published" : "2026-02-17T18:44:07Z",
  "aliases" : [ "CVE-2026-25242" ],
  "summary" : "Unauthenticated File Upload in Gogs",
  "details" : "Security Advisory:Unauthenticated File Upload in Gogs\nVulnerability Type: Unauthenticated File Upload\nDate: Aug 5, 2025\nDiscoverer: OpenAI Security Research\n\n## Summary\nGogs 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.\n\n## Affected Versions\n\n- Software: [Gogs](https://github.com/gogs/gogs/tree/main)\n- Confirmed Version(s): 28f83626d4ed0aa7b89493be2ea8b79ca038331e\n- Likely Affected: All versions since 2020-04-05 with unauthenticated attachments endpoints\n- Introduced Commit: 07818d5fa\n\n## Vulnerability Details\nThe web.go router exposes the following endpoints under the ignSignIn route group:\n\n### Vulnerable Code Snippet\n```\nm.Post(\"/issues/attachments\", repo.UploadIssueAttachment)\nm.Post(\"/releases/attachments\", repo.UploadReleaseAttachment)\n```\nThese 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.\n\nWhile CSRF protection is enabled, attackers can obtain a valid token anonymously from the site and use it in the upload request without authentication.\n## Description\nAnonymous file upload using only default configuration and a CSRF token obtained from the homepage.\n## POC\n```\n# Run Gogs docker \ndocker start gogs\n\n# Software will be run on http://localhost:10880/. Finish the setup with local Sqlite database\n\n# Get CSRF cookie into a jar\ncurl -sS -c cookies.txt http://localhost:10880/ -o /dev/null\n\n# Extract the _csrf value from the jar\nCSRF=\"$(awk '$6==\"_csrf\"{print $7}' cookies.txt | tail -n1)\"\n\n# Upload the file, sending cookie jar + header\ncurl -sS \\\n  -b cookies.txt -c cookies.txt \\\n  -H \"X-CSRF-Token: $CSRF\" \\\n  -H \"Referer: http://localhost:10880/\" \\\n  -F \"file=@image.png\" \\\n  http://localhost:10880/issues/attachments\n\n => {\"uuid\":\"<UUID>\"}\n```\nThe attachment will be available at: http://localhost:10880/attachments/<uuid>\n\n## Impact\n**Unrestricted File Upload:** Attackers can store arbitrary content on the server.\n**Denial-of-Service:** Repeated uploads can exhaust disk space.\n**Malware Hosting:** Gogs may inadvertently serve attacker-hosted payloads under its domain.\n\n## Realistic Exploitation Scenarios\n\n- Spammers or malicious actors use the Gogs instance to host phishing payloads or malware.\n- Attackers fill up disk with repeated uploads.\n- Attackers use hosted Gogs instances as public file dumps (e.g., for P2P, exfiltration)\n\n## Potential Impact\nThis 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.\n\n## Timeline\n\n- August 2025: Discovered via GPT5\n- August 2025: Reproduced and confirmed via PoC and sanitizer\n- Aug 6, 2025 - Sent to Gogs via https://github.com/gogs/gogs/security/advisories/new",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gogs.io/gogs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.14.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/security/advisories/GHSA-fc3h-92p8-h36f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25242"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/pull/8128"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/commit/628216d5889fcb838c471f4754f09b935d9cd9f3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gogs/gogs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/releases/tag/v0.14.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-17T18:44:07Z",
    "nvd_published_at" : "2026-02-19T07:17:45Z"
  }
}