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-RCE-PoC — 🫖 Direct single-target Gitea CVE-2026-60004 RCE validation PoC | Kitploit
Tools/GitHubGitHub/infosec-db/cve-2026-60004-gitea-rce-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & Education
GitHubinfosec-db/cve-2026-60004-gitea-rce-poc

CVE-2026-60004-Gitea-RCE-PoC

🫖 Direct single-target Gitea CVE-2026-60004 RCE validation PoC

View Repository
111h 15m 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 RCE PoC

A direct, single-target validation tool for Gitea's diffpatch Git-hook remote code execution vulnerability.

Python 3.10+ License: MIT CVE

This repository contains the focused AfterDark validator: one script, one target, one run. There are no discovery, reconnaissance, verification, or other subcommands.

⚠️ Legal and ethical disclaimer

This project is provided only for authorized security testing, defensive validation, research, and education. Use it exclusively on systems you own or have explicit written permission to assess.

The authors and contributors are not responsible for misuse, damage, service interruption, data loss, or legal consequences. You are responsible for following applicable laws, contracts, rules of engagement, and disclosure requirements.

This is an active RCE proof of concept. It creates an account, creates a private repository, writes a contract marker, and executes a command as the Gitea operating-system user. Treat it accordingly. 🛡️

🧠 Vulnerability summary

CVE-2026-60004 affects Gitea's repository diffpatch workflow. An attacker with repository write access can submit controlled patch content that installs and triggers a Git hook, resulting in command execution as the Gitea service account.

ItemDetail
ProductGitea
Affected versions>= 1.17.0, < 1.27.1
Patched version1.27.1
ImpactRemote command execution as the Gitea OS user
Upstream advisoryGHSA-rcr6-4jqh-j84m

Forgejo and other forks require manual implementation review and are not automatically treated as affected.

✨ What the script does

Every run performs one fixed workflow:

  1. Normalizes one exact HTTP or HTTPS target.
  2. Checks the reported Gitea version and blocks known non-affected releases.
  3. Requires an operator-supplied contract number, username, and password.
  4. Refuses to reuse an account that already authenticates.
  5. Attempts to register exactly the supplied test account.
  6. Creates a uniquely named private repository.
  7. Installs and triggers the crafted post-index-change hook through diffpatch.
  8. Writes the contract marker and runs id by default.
  9. Retrieves command output through a temporary Git reference.
  10. Saves local JSON evidence and full command output.

The tool accepts only a single target. It has no target-list, wildcard, mass-scan, or passive-discovery mode.

📦 Requirements

  • Python 3.10 or newer
  • Git available in PATH
  • Explicit written authorization for the selected target
  • Gitea self-registration enabled
  • A brand-new disposable username and password for the run

The script uses only Python's standard library. No pip install is required.

🚀 Install

root@kitploit:~
git clone https://github.com/InfoSec-DB/CVE-2026-60004-Gitea-RCE-PoC.git
cd CVE-2026-60004-Gitea-RCE-PoC
python3 scanner.py --help

🧪 Usage

root@kitploit:~
python3 scanner.py \
  --contract-number ENG-2026-001 \
  --username audit-eng-2026-001 \
  --password 'use-a-unique-disposable-password' \
  https://gitea.example

Short options are also available:

root@kitploit:~
python3 scanner.py \
  -c ENG-2026-001 \
  -u audit-eng-2026-001 \
  -p 'use-a-unique-disposable-password' \
  https://gitea.example

🚨 The password is supplied on the command line and displayed in the final result panel. Use only a unique disposable test credential. Be aware that command-line arguments may be retained in shell history or temporarily visible to local process-inspection tools.

Custom authorized command

The default command is id. A narrowly scoped custom command can be supplied with --cmd:

root@kitploit:~
python3 scanner.py \
  -c ENG-2026-001 \
  -u audit-eng-2026-001 \
  -p 'use-a-unique-disposable-password' \
  --cmd 'uname -a' \
  https://gitea.example

Custom commands intentionally have no timeout. The validator waits until the remote command exits, so avoid interactive or long-running commands unless the engagement specifically requires them.

Output location

By default, each run writes beneath:

root@kitploit:~
afterdark-results/<contract>/<UTC timestamp>/

You can select a different root or exact run directory:

root@kitploit:~
python3 scanner.py \
  -c ENG-2026-001 \
  -u audit-eng-2026-001 \
  -p 'use-a-unique-disposable-password' \
  --results-root ./engagement-evidence \
  https://gitea.example
root@kitploit:~
python3 scanner.py \
  -c ENG-2026-001 \
  -u audit-eng-2026-001 \
  -p 'use-a-unique-disposable-password' \
  --output-dir ./engagement-evidence/run-01 \
  https://gitea.example

🧾 Evidence

Each run creates private 0600 files and refuses to overwrite existing results:

  • confirmation.json — target, version result, account name, timestamps, command, return code, and captured artifacts
  • confirmation.command-output.txt — complete remote command output

Evidence may contain sensitive engagement information. Do not commit it to Git. The included .gitignore excludes the default result paths and common evidence filenames.

🧹 Cleanup

The validator does not automatically delete server-side artifacts. After the assessment, an authorized administrator should:

  • Delete the supplied disposable test account
  • Delete the generated private afterdark-* repository
  • Remove /tmp/gitea-validation-<contract>/client.txt
  • Securely archive or delete local evidence
  • Upgrade Gitea to 1.27.1 or later
  • Perform a minimal remediation retest if permitted

A successful result proves command execution as the Gitea service account. It does not by itself prove root access, persistence, lateral movement, or complete host compromise.

🛡️ Built-in boundaries

  • Direct execution with no operational subcommands
  • One exact target per run
  • No wildcard or target-file support
  • Contract-correlated HTTP User-Agent and filesystem marker
  • Version gate before active validation
  • Mandatory operator-selected new account credentials
  • Duplicate-account refusal
  • Private repository creation
  • Default command limited to id
  • Private exclusive-create evidence files
  • Password redaction from captured child output
  • 180-second timeout for the default validation path

✅ Local tests

The tests exercise parsing and PoC construction without making network requests:

root@kitploit:~
python3 -m unittest discover -s tests -v

🤝 Responsible contributions

Improvements that make the validator safer, more reliable, or easier to clean up are welcome. Do not submit real target details, credentials, private evidence, or destructive payloads.

For vulnerabilities in this tool, follow SECURITY.md.

📚 References and credit

  • Official Gitea advisory: GHSA-rcr6-4jqh-j84m
  • Gitea releases
  • CVE reporter credited by the upstream advisory: NightRang3r
  • Validator maintained by the AfterDark Security Research Group

Built for careful, contract-bound security validation. 🫖🛡️

Download Tool