CVE-2026-125423

Gitea command execution through repository auto-initialization

Published Nov 15, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
A repository created with auto-init accepted pushes before its initialization had finished, and the initial commit was built in a checkout of whatever the repository already contained. A user who is allowed to create repositories could push a crafted tree during that window so that writing the README followed a symbolic link and overwrote a server-side git hook, which runs commands as the Gitea system user. The initial commit is now built in a freshly initialized directory, and a new repository only becomes ready, and accepts pushes, once its initialization is complete.

Analysis

AI-generated

Technical impact

A freshly created repository that uses auto‑initialization can accept a push before the initialization process has finished. An attacker who can create repositories can push a crafted file tree during this window; when the server writes the README, it follows a symbolic link that points to the repository’s git hook directory, overwriting the pre‑existing hook. Git hooks run with the permissions of the Gitea system user, giving the attacker arbitrary command execution. This flaw is a classic race condition that allows privilege escalation on the host machine.

Affected Systems

All installations of Gitea that permit users to create new repositories are potentially affected. Specific version information is not provided in the advisory; the fix was released with Gitea 28.4.0, so any earlier version that still enables auto‑initialization may be vulnerable.

Risk and Exploitability

The exploit requires only the ability to create a repository and push an initial commit, so it is widely accessible to users with that privilege. No EPSS score is available and the vulnerability is not listed in the CISA KEV catalog, but the impact is severe; the CVSS score is not disclosed, yet the nature of the flaw suggests high severity. Attackers can achieve remote code execution by overwriting server‑side git hooks, compromising the control plane of the Gitea instance. Timing of the push relative to the auto‑initialization is critical, but the race window is long enough for a determined attacker to succeed.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Gitea to version 28.4.0 or later, which contains the patch that removes the race condition in auto‑initialization.
  • Restrict repository creation rights to trusted users or disable auto‑initialization if it is not required for workflow.
  • Review Git hook directories for unexpected changes and audit hook execution logs for anomalous activity.

Generated by OpenCVE AI on November 15, 2026 at 22:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Gitea
Gitea gitea
Vendors & Products Gitea
Gitea gitea
Type Values Removed Values Added
Description A repository created with auto-init accepted pushes before its initialization had finished, and the initial commit was built in a checkout of whatever the repository already contained. A user who is allowed to create repositories could push a crafted tree during that window so that writing the README followed a symbolic link and overwrote a server-side git hook, which runs commands as the Gitea system user. The initial commit is now built in a freshly initialized directory, and a new repository only becomes ready, and accepts pushes, once its initialization is complete.
Title Gitea command execution through repository auto-initialization
Weaknesses CWE-362
CWE-59
References
Weaknesses
  • CWE-362

    Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')

Sources

Status
PUBLISHED
Assigner
Gitea
Published
Updated
Nov 15, 2026, 9:10 PM
Reserved
Nov 15, 2026, 8:29 PM
Status
Deferred
Published
Nov 15, 2026, 9:16 PM
Modified
Nov 15, 2026, 9:16 PM