CVE-2026-25714

CVE-2026-25714 is a medium-severity missing authorization vulnerability in code.gitea.io/gitea (go), affecting versions <= 1.26.1. It is fixed in 1.26.2.

Check whether CVE-2026-25714 affects your applications

Kodem tells you whether this CVE is present, reachable, and actually executing in your application, so you know if it matters.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence. Only the CVEs that actually run in production.

Summary

Gitea: Incomplete CVE-2025-68941 fix: /user/orgs missing checkTokenPublicOnly + switch-case logic flaw

Full technical description

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:

m.Get("/user/orgs", reqToken(), tokenRequiresScopes(
    auth_model.AccessTokenScopeCategoryUser,
    auth_model.AccessTokenScopeCategoryOrganization,
), org.ListMyOrgs)
// Missing checkTokenPublicOnly()

Adjacent route at line 1603 has it:

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.

Version

Current main branch, commit 2c2d7e6 (April 3, 2026).

Impact

Public-only scoped tokens can enumerate private organizations the token owner belongs to. Violates the token's declared scope constraints.

The application does not perform an authorization check before performing a sensitive operation. Typical impact: unauthorized access to restricted functionality or data.

CVE-2026-25714 has a CVSS score of 4.3 (Medium). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.26.2); upgrading removes the vulnerable code path.

Affected versions

code.gitea.io/gitea (<= 1.26.1)

Security releases

code.gitea.io/gitea → 1.26.2 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

  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

Frequently Asked Questions

  1. What is CVE-2026-25714? CVE-2026-25714 is a medium-severity missing authorization vulnerability in code.gitea.io/gitea (go), affecting versions <= 1.26.1. It is fixed in 1.26.2. The application does not perform an authorization check before performing a sensitive operation.
  2. How severe is CVE-2026-25714? CVE-2026-25714 has a CVSS score of 4.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of code.gitea.io/gitea are affected by CVE-2026-25714? code.gitea.io/gitea (go) versions <= 1.26.1 is affected.
  4. Is there a fix for CVE-2026-25714? Yes. CVE-2026-25714 is fixed in 1.26.2. Upgrade to this version or later.
  5. Is CVE-2026-25714 exploitable, and should I be worried? Whether CVE-2026-25714 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-25714 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-25714? Upgrade code.gitea.io/gitea to 1.26.2 or later.

Other vulnerabilities in code.gitea.io/gitea

Stop the waste.
Protect your environment with Kodem.