Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-60004-gitea-0day — CVE-2026-60004 — Gitea <= 1.27.0 Pre-Auth RCE | Kitploit
Tools/GitHubGitHub/sachinart/cve-2026-60004-gitea-0day
ExploitationWeb Application ExploitationPost-ExploitationCTFPenetration TestingRemote Access Tool
GitHubsachinart/cve-2026-60004-gitea-0day

CVE-2026-60004-gitea-0day

CVE-2026-60004 — Gitea <= 1.27.0 Pre-Auth RCE

View Repository
81 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-60004 - Gitea <= 1.27.0 Pre-Auth RCE

This is a proof-of-concept exploit for CVE-2026-60004, a critical remote code execution vulnerability in Gitea versions 1.17 through 1.27.0. The script automates the full exploitation chain, from user registration to establishing a stable, interactive shell on the target server.

Background

The vulnerability exists in the /diffpatch API endpoint. By sending a malicious patch twice, an add/add collision triggers a three-way merge fallback that ignores the --cached flag and writes an executable Git hook directly into the bare repository's GIT_DIR. When Git updates the index, it automatically executes this hook, allowing arbitrary command execution as the Gitea service account.

Because Gitea is a compiled Go binary without an embedded PHP interpreter, dropping a traditional webshell often fails if there isn't a secondary web server configured to execute it. To solve this and ensure the exploit is completely stable, this script uses an API-driven approach:

  1. It plants a post-index-change git hook via the diffpatch collision.
  2. The hook reads a command from a tracked file (cmd.sh), executes it as the service account, and writes the output to a git blob ().
proof
  • The script retrieves the output via Gitea's own Raw API endpoint.
  • This creates a fully functional interactive shell directly through the Gitea API, requiring no external web servers or secondary interpreters.

    Features

    • Fully Automated: Handles CSRF token extraction, user registration, repository creation, and exploit delivery.
    • Pre-Auth Exploitation: Only requires open registration on the target Gitea instance.
    • Interactive Shell: Drops the user into a stable terminal where every command executes reliably.
    • Stable Execution: Uses a clean 3-step patching sequence (Delete, Create, Collision) for every command to ensure the hook fires correctly without throwing 500 errors.

    Usage

    root@kitploit:~
    python3 poc.py https://target.com
    
    image

    Once executed, the script will automatically register an account, plant the malicious hook, and drop you into an interactive shell:

    root@kitploit:~
      ---------------------------------------------------
      CVE-2026-60004 -- Gitea <= 1.27.0 Pre-Auth RCE
      Fully Interactive API Shell
      ---------------------------------------------------
    
    [*] Fetching CSRF token from signup page...
    [+] CSRF token acquired.
    [*] Registering user: poc5wp6tp
    [+] Authenticated as poc5wp6tp
    [*] Creating repository: poc-ozirkq
    [+] Repository created.
    [*] Fetching main branch SHA...
    [*] Planting malicious hook via add/add collision...
    [+] Hook planted and triggered.
    [*] Verifying RCE...
    [+] RCE VERIFIED! Shell is ready.
    uid=1000(git) gid=1000(git) groups=1000(git)
    
    ==================================================
      Gitea API-driven Interactive Shell
      Type 'exit' to quit
    ==================================================
    
    gitea-rce$ whoami
    git
    gitea-rce$ ls -la /data/gitea/repositories
    ...
    gitea-rce$ cat /data/gitea/conf/app.ini
    ...
    

    Disclaimer

    This tool is intended for educational purposes and authorized security testing, such as CTFs, only. Ensure you have explicit permission to test the target system. The author is not responsible for any misuse or damage caused by this tool.

    Credit

    Chirag Artani - https://3rag.com

    Download Tool