Gitea
CVE-2025-68939
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to attachment API
-
ExploitUpload allowed-type attachment
-
ExecutionEdit attachment name to forbidden extension
-
ImpactBypass 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
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).
Primary rating from NVD.
CVSS VectorNVD
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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
Remote code execution in Gitea (self-hosted Git service) via a code-injection flaw (CWE-94) allows attackers to run arbi
Broken access control in Gitea's Composer package registry (versions up to and including 1.26.1) lets remote attackers r
Gitea before 1.16.7 does not escape git fetch remote. Rated high severity (CVSS 7.5), this vulnerability is remotely exp
The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer envir
Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Gitea Gitea
Authenticated command injection in Dokploy (self-hostable PaaS) versions 0.29.3 through 0.29.12 lets a low-privileged us
Reverse-proxy authentication bypass in the official Gitea Docker image (versions up to and including 1.26.2) allows any
Path traversal in Gitea's Org-mode (`.org`) markup renderer allows an attacker who can get Org-mode content rendered by
Container escape in Gitea act_runner (Docker backend, through act 0.262.0) lets an authenticated user with workflow-exec
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
Server-side request forgery and internal repository exfiltration in Gitea before 1.27.0 lets a low-privileged authentica
Authorization bypass in Gitea versions 1.22.3 through 1.26.1 allows holders of `public-only` access tokens or OAuth gran
NVD
CVE.org
EPSS
GitHub
Exploit-DB