Skip to main content

Gitea CVE-2025-68939

MEDIUM
Improper Protection of Alternate Path (CWE-424)
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
    Authenticate to attachment API
  2. Exploit
    Upload allowed-type attachment
  3. Execution
    Edit attachment name to forbidden extension
  4. Impact
    Bypass AllowedTypes file-type restriction

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Alternate path protection
Exploitation Conditions

Requires an authenticated caller able to reach the attachment edit endpoints (EditIssueAttachment, EditIssueCommentAttachment, or EditReleaseAttachment) with rights to modify an existing attachment on an issue, comment, or release. The specific precondition is that pre-1.23.0 Gitea enforced the configured AllowedTypes allow-list only during UploadAttachment and not during the attachment-name update path, so the attacker must first create a valid attachment and then rename it via the API. LIMITING FACTORS: exploitation only matters when the instance relies on the AllowedTypes allow-list to restrict extensions (default AllowedTypes is unrestricted in many deployments, limiting impact); it requires API access and attachment-management privileges rather than fully anonymous access; and impact is confined to storing/serving a disallowed extension, not code execution on the server.

Impact

This is a low-to-moderate priority issue despite the 'high-sounding' exploit-bypass framing. The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N) scores 5.3 (Medium) with only Integrity-Low impact (C:N/I:L/A:N), reflecting that the flaw merely lets an attacker store an attachment whose extension would normally be blocked by the instance's AllowedTypes allow-list - it is not RCE or data theft. EPSS is low at 0.33% (24th percentile), the CVE is NOT on CISA KEV, and no public exploit is identified in the provided data, so exploitation status is 'no public exploit identified at time of analysis.' These signals are consistent with each other: low EPSS, no KEV, no POC, and a modest CVSS all point to a non-urgent, low-real-risk defect. CONFLICT TO VERIFY: the input vector lists PR:N (unauthenticated), but the fixed code (EditIssueAttachment/EditReleaseAttachment, authenticated API endpoints) and the nature of editing an existing attachment imply an authenticated API call is required - the PR:N rating is likely overstated; verify authentication requirement with the vendor. The CWE (CWE-424, Improper Protection of Alternate Path) and the 'Information Disclosure' tag also disagree with the actual integrity/restriction-bypass nature of the bug.

Exploit ScenarioDerived

An authenticated user with permission to manage attachments uploads a benign, allowed file via the Gitea attachment API, then calls the edit-attachment endpoint to rename it to a normally-forbidden extension (e.g. an executable or script type) because pre-1.23.0 Gitea validated the extension only on upload, not on update. The attachment is then served from the instance with the forbidden extension, undermining the configured AllowedTypes policy. No public POC is referenced in the provided data.

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

Gitea deployments running releases before 1.23.0 let an authenticated user who holds rights to modify an existing issue, comment, or release attachment rename that attachment to a forbidden file extension, bypassing the instance's configured AllowedTypes allow-list. Because the extension/type check was enforced only on the upload path and not on the attachment-name update path, an attacker can first upload a permitted file and then rename it through the attachment API (the issue, issue-comment, or release asset endpoints), causing Gitea to store and serve a file type that the operator intended to block. The fix in 1.23.0 routes renames through the same verification service and returns HTTP 422 for a forbidden extension. Exploitation requires API access plus attachment-management privileges rather than fully anonymous access, only matters where administrators actually rely on AllowedTypes to restrict extensions (default AllowedTypes is unrestricted in many deployments), and the outcome is storing/serving a disallowed file type rather than server-side code execution. EPSS is 0.33% (24th percentile) and no public exploit has been identified at time of analysis.

RemediationAI

Vendor-released patch: upgrade to Gitea 1.23.0 or later, which applies the upload.Verify allow-list check on attachment rename and returns 422 for forbidden extensions; see the release notes at https://blog.gitea.com/release-of-1.23.0/ and the release tag at https://github.com/go-gitea/gitea/releases/tag/v1.23.0, with the fix merged in https://github.com/go-gitea/gitea/pull/32151. If an immediate upgrade is not possible, apply targeted compensating controls: audit whether the instance actually relies on setting.Attachment.AllowedTypes and setting.Repository.Release.AllowedTypes to block risky extensions (e.g., .html, .svg, .js, executables) - because the flaw only has security value where that allow-list is deliberately restrictive, deployments with the default unrestricted AllowedTypes face limited impact and should prioritise the upgrade accordingly. Restrict creation and use of API tokens with repository write access to trusted principals, since the bypass requires an authenticated caller with attachment-edit rights, and consider blocking PATCH on /api/v1/repos/*/issues/*/assets/*, /api/v1/repos/*/issues/comments/*/assets/*, and /api/v1/repos/*/releases/*/assets/* at a reverse proxy or WAF as an interim measure, accepting that this breaks legitimate attachment renaming and any automation that renames assets. Additionally, periodically audit stored attachment names for extensions outside the intended allow-list and remove any offending entries, and where attachments are served inline, set a Content-Disposition: attachment header or an isolating Content-Security-Policy so a disallowed file type cannot be rendered in the Gitea origin as a client-side attack vector; both measures add operational overhead and the proxy rule in particular can cause user-visible breakage, so they should be treated as temporary until 1.23.0 is deployed.

Affected Packages

go code.gitea.io/gitea no fix

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

The root cause is CWE-424 (Improper Protection of Alternate Path): Gitea's upload service exposed a Verify() routine that validates a file's name/extension (and, when a content buffer is supplied, its detected type) against the configured AllowedTypes string, and UploadAttachment applied that check on creation. However, the alternate path used to rename an attachment - repo_model.UpdateAttachment, invoked by the EditIssueAttachment, EditIssueCommentAttachment, and EditReleaseAttachment handlers in routers/api/v1/repo - persisted the new attachment name without re-validating it, so the allow-list could be circumvented simply by editing the attachment name after a legitimate upload. The upstream fix (GitHub PR 32151) adds services/attachment.UpdateAttachment, a wrapper that calls upload.Verify(nil, attach.Name, allowedTypes) before delegating to repo_model.UpdateAttachment, and wires it into all three edit handlers, which now return HTTP 422 (validation error) when upload.IsErrFileTypeForbidden fires; the change also updates Verify so an empty content buffer performs the extension-only check, and rewords the forbidden-type error message to cover modification as well as upload. The affected configuration keys are setting.Attachment.AllowedTypes (issue and comment attachments) and setting.Repository.Release.AllowedTypes (release attachments). The CPE wildcard cpe:2.3:a:gitea:gitea:*:*:*:*:*:-:*:* indicates every tracked Gitea release prior to the 1.23.0 fix. The attacker-visible surface is the repository attachment API: PATCH/rename operations on /repos/{owner}/{repo}/issues/{index}/assets/{id}, /repos/{owner}/{repo}/issues/comments/{comment_id}/assets/{id}, and /repos/{owner}/{repo}/releases/{id}/assets/{id}.

Severity by source

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

Editing an existing attachment via the authenticated API needs write privileges, so PR:L not PR:N; network vector, low complexity, and only a low integrity impact (restriction bypass, no C or A).

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

Primary rating from NVD.

CVSS VectorNVD

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

DescriptionNVD

Gitea before 1.23.0 allows attackers to add attachments with forbidden file extensions by editing an attachment name via an attachment API.

Threat Intelligence Overview

EPSS Score
0.3%
Top 76% exploitable
Prevalence
Medium
popular self-hosted Git service, common but not ubiquitous like GitHub/GitLab
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

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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