CVE-2026-25714: Gitea Incomplete CVE-2025-68941 Fix: /user/orgs Missing Vulnerability

MODERATE
Advisory Identifier: GHSA-8629-vc8r-5p58
CVSS 4.3
CWE-862
Published
Advisory Summary

CVE-2026-25714 is a MODERATE (CVSS 4.3) incomplete cve-2025-68941 fix: /user/orgs missing vulnerability (CWE-862: Missing Authorization) affecting Gitea libraries in the Go ecosystem. The issue involves incomplete cve-2025-68941 fix: /user/orgs missing checktokenpubliconly + switch-case logic flaw. Remediation is available by upgrading affected packages to version 1.26.2.

CVE-2026-25714 at a Glance

CVE Identifier CVE-2026-25714
GHSA Identifier GHSA-8629-vc8r-5p58
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-862: Missing Authorization
Affected Product Gitea
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-25714

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

code.gitea.io/gitea fixed: 1.26.2
Upgrade code.gitea.io/gitea to 1.26.2
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 code.gitea.io/gitea

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-25714, inspect your project dependencies for Gitea:

inspect dependencies for code.gitea.io/gitea

Analyze the terminal output to locate any version of Gitea in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.26.2), 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 Gitea, 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

## Summary Two related issues in the token public-only scope enforcement introduced by PR #32204 (CVE-2025-68941 fix). A public-only scoped API token can access private organization data. ## Issue 1: /user/orgs missing checkTokenPublicOnly() `routers/api/v1/api.go` line 1599: ```go m.Get("/user/orgs", reqToken(), tokenRequiresScopes( auth_model.AccessTokenScopeCategoryUser, auth_model.AccessTokenScopeCategoryOrganization, ), org.ListMyOrgs) // Missing checkTokenPublicOnly() ``` Adjacent route at line 1603 has it: ```go m.Group("/users/{username}/orgs", func() { ... }, ..., checkTokenPublicOnly()) ``` ## Issue 2: checkTokenPublicOnly switch-case evaluates only first matching category `routers/api/v1/api.go` lines 253-295. Go switch executes only the first matching case. For routes with categories [User, Organization]: 1. Organization case matches first (line 263) 2. ctx.Org.Organization is nil on user routes, passes 3. ctx.ContextUser.IsOrganization() is false, passes 4. User case (line 273) is never reached 5. User visibility check skipped entirely ## Steps to Reproduce 1. Create a token with public-only scope (Settings > Applications > check "public only") 2. Call: `curl -H "Authorization: token <PUBLIC_ONLY_TOKEN>" https://gitea.example.com/api/v1/user/orgs` 3. Response includes private and limited-visibility organizations Expected: only public organizations returned. ## Impact Public-only scoped tokens can enumerate private organizations the token owner belongs to. Violates the token's declared scope constraints. ## Suggested Fix 1. Add `checkTokenPublicOnly()` to `/user/orgs` route at line 1599 2. Replace switch with loop over all categories so User visibility check is not skipped ## Version Current main branch, commit 2c2d7e6 (April 3, 2026).

CVE-2026-25714 Affected Gitea Versions

1 component(s)
Fixed Versions:
1.26.2
Product / Package Ecosystem Affected Versions Fixed Version
code.gitea.io/gitea
Go
< 1.26.2
1.26.2

References

Frequently Asked Questions

What is CVE-2026-25714?
CVE-2026-25714 is a security vulnerability in Gitea involving Incomplete CVE-2025-68941 fix: /user/orgs missing checkTokenPublicOnly + switch-case logic flaw under CWE-862: Missing Authorization.
Which Gitea versions are affected?
Affected versions include releases prior to 1.26.2 across affected packages: code.gitea.io/gitea.
What version fixes CVE-2026-25714?
Upgrading to 1.26.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is code.gitea.io/gitea affected?
Yes, code.gitea.io/gitea is affected in releases prior to 1.26.2. Upgrade your dependency to 1.26.2 or later.
What is the CVSS score of CVE-2026-25714?
CVE-2026-25714 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-25714?
CVE-2026-25714 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-25714?
Run the dependency tree command: 'inspect dependencies for code.gitea.io/gitea'. 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-8629-vc8r-5p58",
  "modified" : "2026-06-16T23:41:31Z",
  "published" : "2026-06-16T23:41:31Z",
  "aliases" : [ "CVE-2026-25714" ],
  "summary" : "Gitea: Incomplete CVE-2025-68941 fix: /user/orgs missing checkTokenPublicOnly + switch-case logic flaw",
  "details" : "## Summary\n\nTwo related issues in the token public-only scope enforcement introduced by PR #32204 (CVE-2025-68941 fix). A public-only scoped API token can access private organization data.\n\n## Issue 1: /user/orgs missing checkTokenPublicOnly()\n\n`routers/api/v1/api.go` line 1599:\n```go\nm.Get(\"/user/orgs\", reqToken(), tokenRequiresScopes(\n    auth_model.AccessTokenScopeCategoryUser,\n    auth_model.AccessTokenScopeCategoryOrganization,\n), org.ListMyOrgs)\n// Missing checkTokenPublicOnly()\n```\n\nAdjacent route at line 1603 has it:\n```go\nm.Group(\"/users/{username}/orgs\", func() { ... },\n    ..., checkTokenPublicOnly())\n```\n\n## Issue 2: checkTokenPublicOnly switch-case evaluates only first matching category\n\n`routers/api/v1/api.go` lines 253-295. Go switch executes only the first matching case. For routes with categories [User, Organization]:\n\n1. Organization case matches first (line 263)\n2. ctx.Org.Organization is nil on user routes, passes\n3. ctx.ContextUser.IsOrganization() is false, passes\n4. User case (line 273) is never reached\n5. User visibility check skipped entirely\n\n## Steps to Reproduce\n\n1. Create a token with public-only scope (Settings > Applications > check \"public only\")\n2. Call: `curl -H \"Authorization: token <PUBLIC_ONLY_TOKEN>\" https://gitea.example.com/api/v1/user/orgs`\n3. Response includes private and limited-visibility organizations\n\nExpected: only public organizations returned.\n\n## Impact\n\nPublic-only scoped tokens can enumerate private organizations the token owner belongs to. Violates the token's declared scope constraints.\n\n## Suggested Fix\n\n1. Add `checkTokenPublicOnly()` to `/user/orgs` route at line 1599\n2. Replace switch with loop over all categories so User visibility check is not skipped\n\n## Version\n\nCurrent main branch, commit 2c2d7e6 (April 3, 2026).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "code.gitea.io/gitea"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.26.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.26.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/security/advisories/GHSA-8629-vc8r-5p58"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-gitea/gitea"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-16T23:41:31Z",
    "nvd_published_at" : null
  }
}