Skip to main content
Vulnerability Database/CVE-2026-86684

CVE-2026-86684: Gitea Privilege Escalation Vulnerability

CVE-2026-86684 is a privilege escalation flaw in Gitea that allows repository administrators to bypass local path restrictions through push mirror configurations. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-86684 Overview

CVE-2026-86684 is an authorization flaw in Gitea's push mirror API. The API checks whether the repository owner, rather than the requesting user, holds permission to use local file system paths. On instances configured with [security] IMPORT_LOCAL_PATHS = true, a repository administrator without local-path import rights can configure a push mirror targeting a local file system path. Gitea then writes the repository's refs into an existing Git repository at that path using the privileges of the Gitea process. The flaw is classified under CWE-863: Incorrect Authorization.

Critical Impact

An authenticated repository administrator can overwrite refs in arbitrary local Git repositories accessible to the Gitea process, potentially modifying other repositories on the host.

Affected Products

  • Gitea instances prior to version 28.1.0
  • Gitea deployments with [security] IMPORT_LOCAL_PATHS = true
  • Self-hosted Gitea servers where repository owners hold local-path import permissions

Discovery Timeline

  • 2026-10-06 - CVE-2026-86684 published to NVD
  • 2026-10-07 - Last updated in NVD database

Technical Details for CVE-2026-86684

Vulnerability Analysis

The vulnerability resides in Gitea's push mirror API authorization logic. When a user submits a request to configure a push mirror, the API determines whether local file system paths are permitted. The permission check evaluates the repository owner's privileges instead of the requesting user's privileges. This creates a privilege confusion where a lower-privileged repository administrator inherits the owner's broader permissions for the duration of the mirror configuration call.

Once the mirror is accepted, Gitea executes push operations against the specified local path using its process identity. If an existing Git repository resides at that path, Gitea writes repository refs into it. The attack requires an authenticated administrator role on a repository and a Gitea configuration where IMPORT_LOCAL_PATHS is enabled, which is not the default setting.

Root Cause

The root cause is an incorrect subject in the authorization decision. The access control code evaluates repository.Owner.CanImportLocal() instead of ctx.Doer.CanImportLocal(). This substitution of principals when enforcing a sensitive capability constitutes an authorization bypass under [CWE-863].

Attack Vector

An authenticated repository administrator identifies a repository whose owner has local-path import permission. The attacker calls the push mirror API with a remote_address pointing to a local file system path containing an existing Git repository. Gitea accepts the configuration, performs the mirror push, and overwrites refs in the target repository with the attacker's branch content. The attack requires IMPORT_LOCAL_PATHS = true in the server configuration. See the Gitea Security Advisory GHSA-7v5j-mph8-9w6g for additional detail.

Detection Methods for CVE-2026-86684

Indicators of Compromise

  • Push mirror configurations in the Gitea database with remote_address values pointing to local file system paths rather than remote URLs
  • Unexpected ref updates or branch overwrites in Git repositories co-located on the Gitea host
  • API audit entries for POST /repos/{owner}/{repo}/push_mirrors originating from non-owner administrators

Detection Strategies

  • Query the Gitea push_mirror table for remote_address values that resolve to local file paths such as those beginning with /, file://, or UNC paths
  • Correlate push mirror creation events with the acting user's permissions to identify configurations by non-owner administrators
  • Review Git repository reflogs on the Gitea host for unexpected updates originating from the Gitea process

Monitoring Recommendations

  • Enable and ship Gitea application logs and API access logs to a centralized log platform for retention and querying
  • Alert on any creation or modification of push mirror configurations where the destination parses as a local path
  • Monitor file system changes to directories containing Git repositories owned by the Gitea service account

How to Mitigate CVE-2026-86684

Immediate Actions Required

  • Upgrade Gitea to version 28.1.0 or later as published in the Gitea Release v28.1.0 notes
  • Audit all existing push mirror configurations and remove any that reference local file system paths
  • Review which users hold repository administrator roles on repositories owned by accounts with local-path import permission

Patch Information

The fix is included in Gitea 28.1.0. The code changes landed in Gitea Pull Request #39501 and Gitea Pull Request #39507. The release is documented in the Gitea Blog Release Announcement and the Gitea Security Advisory GHSA-7v5j-mph8-9w6g.

Workarounds

  • Set [security] IMPORT_LOCAL_PATHS = false in app.ini to disable local path imports entirely until patching is complete
  • Restrict the ALLOWED_USER_VISIBILITY_MODES and repository owner permissions so that no accounts hold local-path import rights
  • Run the Gitea process under a dedicated service account with minimal file system access outside its own data directory
bash
# Configuration example: disable local path imports in app.ini
[security]
IMPORT_LOCAL_PATHS = false

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.