Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-60004 — Gitea diffpatch RCE (CVE-2026-60004) PoC - repo-write to RCE as Gitea service account | Kitploit
Tools/GitHubGitHub/hackspeak/cve-2026-60004
Privilege EscalationVulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingRed TeamingPayload Development
GitHubhackspeak/cve-2026-60004

CVE-2026-60004

Gitea diffpatch RCE (CVE-2026-60004) PoC - repo-write to RCE as Gitea service account

1493 months agoNot yet reviewed
Share
View Repository

CVE-2026-60004 — Gitea diffpatch RCE

Remote code execution PoC for the Gitea diffpatch endpoint. An account with write access to a repository (on instances with open registration, simply registering an account suffices) can execute arbitrary shell commands on the server as the Gitea service account.

Vulnerability Summary

POST /api/v1/repos/{owner}/{repo}/diffpatch applies an attacker-controlled patch in a shared bare temporary clone repository:

git apply --index --recount --cached --binary   # Git ≥ 2.32 时追加 -3 三路合并回退

Attack chain: submitting the same patch twice → add/add conflict → the three-way merge fallback checks out the index paths (even with --cached) → in a bare repository root = $GIT_DIR, and the checked-out hooks/post-index-change (100755) becomes an active Git hook → Git automatically executes it when writing the index → RCE.

  • CVSS: 9.8 (Critical), AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Affected: Gitea ≥ 1.17, < 1.27.1
  • Fix: 1.27.1 (temporary clone changed from bare to non-bare, commit 470d34b1)
  • Reported by: Shai Rod (NightRang3r)

Exploitation Requirements

  • Write access to a repository; or the instance has open registration (default) → just register an account and create a repository
  • Server-side Git ≥ 2.32 (enables the -3 three-way merge)
  • diffpatch endpoint available

Usage

# 设置账户密码
export GITEA_PASSWORD='account-password'

python3 gitea_diffpatch_rce_poc.py \
  https://<gitea-base-url> \
  <username> \
  'id; uname -srm; pwd'
ParameterDescription
urlGitea base URL
usernameAn existing Gitea username (availability: open registration by default)
commandThe shell command to execute on the target
GITEA_PASSWORDAccount password (environment variable, or interactive input)

Requirements: Python 3 + a local git client.

PoC flow: authenticate → create a private initialized repository → craft a hooks/post-index-change patch → deliver it to diffpatch twice in a row (triggering an add/add conflict) → Git executes the hook → retrieve command output over authenticated Smart HTTP. No outbound callback; output is returned in-band.

⚠️ Disclaimer

For security research, vulnerability validation, and defensive testing only. This PoC creates repositories, submits patches, and triggers server-side command execution on the target instance. Run it only on your own test instance; do not use it against unauthorized or production environments.

Attribution & References

  • Official advisory and PoC: GHSA-rcr6-4jqh-j84m (reported by Shai Rod / NightRang3r)
  • Fix commit: 470d34b1
  • Coverage: THN — New Gitea RCE Lets Repository Writers Execute Shell Commands
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    933
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    551
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    354
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    351
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    332
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    289

Explore all tools

Browse our collection of tools

View all tools →