Skip to main content

Gitea CVE-2025-68941

MEDIUM
Incorrect Authorization (CWE-863)
2025-12-26 cve@mitre.org
5.3
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain public-scoped Gitea API token
  2. Exploit
    Call private repo/org/package endpoint
  3. Impact
    Read unauthorized private resource data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization logic validation
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the attacker to already possess a valid Gitea API access token whose scope is explicitly limited to public resources (e.g., a public-only repository, user, organization, package, issue, notification, or ActivityPub scope), and the target must be a private resource (private repository, private org, or private package owner). The limiting factors are significant: a valid token is a prerequisite (not anonymous access despite the PR:N rating), the impact is confined to read access to private data (C:L, no integrity or availability impact), and only Gitea instances running a version before 1.22.3 are affected - upgrading to 1.22.3 fully remediates it.

Impact

This is a broken-authorization flaw (CWE-863) in Gitea where an API token scoped only to public resources is incorrectly honored for private resources, confirmed by the PR #32218 source diff which adds explicit public-only scope checks (checkTokenPublicOnly) across repository, issue, organization, user, ActivityPub, notification, and package endpoints. The published CVSS is 5.3 (Medium) with vector AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - note the C:L/I:N/A:N impact profile correctly reflects that this is an information-disclosure/read-access issue, not code execution. The signals are consistent and point to LOW real-world urgency: EPSS is only 0.26% (17th percentile), there is no CISA KEV listing, and no public exploit was identified in the provided data. One important caveat: the official vector asserts PR:N (unauthenticated), yet the vulnerability by definition requires the attacker to already possess a valid, albeit limited-scope, API token - a prerequisite that is effectively a form of authentication. This conflict should be verified; realistically this behaves as an authenticated privilege/scope-escalation issue (PR:L) rather than a fully anonymous network attack, which further reduces practical risk. Overall this is a legitimate security fix worth patching but not an emergency.

Exploit ScenarioDerived

An attacker (or a compromised integration/CI system) holds a Gitea API token that was deliberately restricted to public-resource scope, expecting it to be unable to touch private data. Because Gitea before 1.22.3 fails to enforce the public-only restriction, the attacker sends ordinary API requests to private repository, organization, user, or package endpoints and successfully reads data the token was never authorized to see. No public exploit code was identified, but the trivial attack complexity (AC:L) means exercising the flaw requires only standard API calls once a public-scoped token is available.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 13, 2026

Broken authorization in Gitea before 1.22.3 causes API tokens scoped only to public resources to be honored when the request targets private resources, allowing an authenticated holder of such a token to read private repositories, organizations, users, packages, issues, notifications, and ActivityPub data. The attacker must already possess a valid Gitea API access token whose scope is explicitly limited to public resources (e.g., public-only repository, issue, organization, user, package, notification, or ActivityPub scopes) and must point it at a private resource on the same instance, so this is an authenticated privilege-scope bypass rather than an anonymous exposure. Impact is confined to read-only information disclosure with no integrity or availability effect; EPSS is 0.26% (17th percentile) and no public exploit code has been identified at time of analysis.

RemediationAI

Vendor-released patch: upgrade to Gitea 1.22.3 or later, which is the version that contains the checkTokenPublicOnly enforcement added in PR #32218 and fully remediates the scope-bypass behavior. Consult the release notes at https://blog.gitea.com/release-of-1.22.3/ and https://github.com/go-gitea/gitea/releases/tag/v1.22.3 before upgrading. Where an immediate upgrade is not possible, audit and revoke API tokens that carry public-only scopes (public-only repository, issue, organization, user, package, notification, or ActivityPub scopes), since those are the only tokens that can trigger the bypass; rotating them invalidates any token an attacker may already hold, at the cost of disrupting legitimate automation that relies on public-scoped tokens. Administrators can additionally disable or restrict API-token creation for untrusted users and review access logs for 200 responses from public-only tokens against private repository, organization, or package endpoints, which would indicate attempted exploitation. Note that network-level blocking is not an effective control here because the requests are legitimate authenticated API calls and must remain reachable for normal Gitea operation.

Affected Packages

go code.gitea.io/gitea fix: 1.22.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in go

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Gitea implements fine-grained API access-token scopes through its auth model, where a token can be issued with categories such as repository, issue, organization, user, package, notification, or activitypub, and a scope.PublicOnly() check is meant to constrain those categories to publicly visible resources. The root cause is CWE-863 (Incorrect Authorization): the public-only restriction was evaluated but not enforced consistently across the API routing middleware, so handlers for private resources proceeded without verifying the token's public-only constraint. The fix in PR #32218 (shipped in 1.22.3) rewrites the tokenRequiresScopes middleware to store requiredScopeCategories and set ctx.PublicOnly, then adds a dedicated checkTokenPublicOnly middleware that rejects requests with HTTP 403 whenever the token is public-only and the target repository, issue, organization, user, or package owner is private; an equivalent public-only check was also added to the package API (routers/api/packages/api.go) and a User.IsUser() helper was introduced in models/user/user.go. The CPE entry cpe:2.3:a:gitea:gitea:*:*:*:*:*:-:*:* covers Gitea releases prior to 1.22.3.

Know when Gitea gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
vuln.today AI 4.3 MEDIUM

Requires a pre-existing valid public-scoped API token so PR:L rather than PR:N; network API access with trivial complexity, and only limited read disclosure of private data (C:L, I/A none).

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Red Hat 4.9 MEDIUM

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

DescriptionNVD

Gitea before 1.22.3 mishandles access to a private resource upon receiving an API token with scope limited to public resources.

Threat Intelligence Overview

EPSS Score
0.3%
Top 83% exploitable
Prevalence
Medium
popular self-hosted git service, common but not universally deployed
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Affected Products (CPE)NVD

cpe:2.3:a:gitea:gitea:*:*:*:*:*:-:*:*

More in Gitea

View all
CVE-2026-60004 CRITICAL POC
9.8

Remote code execution in Gitea (self-hosted Git service) via a code-injection flaw (CWE-94) allows attackers to run arbi

CVE-2026-27771 HIGH POC
8.2 Jul 03

Broken access control in Gitea's Composer package registry (versions up to and including 1.26.1) lets remote attackers r

CVE-2022-30781 HIGH POC
7.5 May 16

Gitea before 1.16.7 does not escape git fetch remote. Rated high severity (CVSS 7.5), this vulnerability is remotely exp

CVE-2020-14144 HIGH POC
7.2 Oct 16

The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer envir

CVE-2024-6886 CRITICAL POC
10.0 Aug 06

Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Gitea Gitea

CVE-2026-72867 CRITICAL POC
9.9 Aug 10

Authenticated command injection in Dokploy (self-hostable PaaS) versions 0.29.3 through 0.29.12 lets a low-privileged us

CVE-2026-20896 CRITICAL POC
9.8 Jul 03

Reverse-proxy authentication bypass in the official Gitea Docker image (versions up to and including 1.26.2) allows any

CVE-2026-59774 CRITICAL POC
9.8

Path traversal in Gitea's Org-mode (`.org`) markup renderer allows an attacker who can get Org-mode content rendered by

CVE-2026-58053 CRITICAL POC
9.4 Jun 28

Container escape in Gitea act_runner (Docker backend, through act 0.262.0) lets an authenticated user with workflow-exec

CVE-2019-11229 HIGH POC
8.8 Apr 15

models/repo_mirror.go in Gitea before 1.7.6 and 1.8.x before 1.8-RC3 mishandles mirror repo URL settings, leading to rem

CVE-2026-57894 HIGH POC
8.5 Jul 21

Server-side request forgery and internal repository exfiltration in Gitea before 1.27.0 lets a low-privileged authentica

CVE-2026-24791 HIGH POC
8.1 Jun 17

Authorization bypass in Gitea versions 1.22.3 through 1.26.1 allows holders of `public-only` access tokens or OAuth gran

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy