CVE-2026-70402

Gitea local code execution through writable Git hooks

Published Oct 14, 2026 CVSS 3.1 · 5.8 Medium EPSS < 1% KEV · Not listed
Description
Gitea creates server-side Git hook directories and scripts with mode 0777 and relies on the process umask to restrict access. With a permissive umask such as 0000 or 0002, another local user who can reach the repository storage may modify a hook or add an executable to a writable hook directory. A later Git operation can execute that file as the Gitea service account.

Analysis

AI-generated

Technical impact

Gitea creates server‑side Git hook directories and scripts with read/write/execute permissions for all users (mode 0777) and depends on the process umask to limit access. When the umask is permissive, such as 0000 or 0002, a local user who can reach the repository storage can add or modify a hook file. Upon the next Git operation, the Gitea service account will execute that file, enabling the local attacker to run arbitrary code with the privileges of the Gitea service process.

Affected Systems

The affected product is Gitea (the open‑source Git management system). Versions prior to 1.27.3 are vulnerable; the issue has been closed in the 1.27.3 release.

Risk and Exploitability

The CVSS score of 5.8 indicates a medium severity vulnerability. The EPSS score is < 1% and the vulnerability is not listed in the CISA KEV catalog, so the likelihood of exploitation in the wild is low but not null. However, the attack requires only local access to the repository storage and a permissive umask, making the exploit straightforward for a local user with file‑system access. Successful exploitation leads to execution of arbitrary code under the Gitea service account, potentially compromising the entire instance.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Gitea to version 1.27.3 or later, which removes the permissive permissions on hook directories.
  • Re‑apply appropriate ownership and permissions to the repository and hook directories, ensuring they are owned by the Gitea service account and not writable by other users.
  • Configure a stricter system umask (e.g., 0022) so that new files default to mode 0755 or less, reducing the possibility of unintended write access.

Generated by OpenCVE AI on October 15, 2026 at 19:33 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
Metrics cvssV3_1

{'score': 5.8, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Gitea creates server-side Git hook directories and scripts with mode 0777 and relies on the process umask to restrict access. With a permissive umask such as 0000 or 0002, another local user who can reach the repository storage may modify a hook or add an executable to a writable hook directory. A later Git operation can execute that file as the Gitea service account.
Title Gitea local code execution through writable Git hooks
Weaknesses CWE-732
References
Weaknesses
  • CWE-732

    Incorrect Permission Assignment for Critical Resource

Sources

Status
PUBLISHED
Assigner
Gitea
Published
Updated
Oct 14, 2026, 3:03 PM
Reserved
Aug 13, 2026, 4:50 PM
Status
Deferred
Published
Oct 14, 2026, 3:17 PM
Modified
Oct 14, 2026, 4:17 PM