
🫖 Direct single-target Gitea CVE-2026-60004 RCE validation PoC
A direct, single-target validation tool for Gitea's
diffpatchGit-hook remote code execution vulnerability.
This repository contains the focused AfterDark validator: one script, one target, one run. There are no discovery, reconnaissance, verification, or other subcommands.
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. 🛡️
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.
| Item | Detail |
|---|---|
| Product | Gitea |
| Affected versions | >= 1.17.0, < 1.27.1 |
| Patched version | 1.27.1 |
| Impact | Remote command execution as the Gitea OS user |
| Upstream advisory | GHSA-rcr6-4jqh-j84m |
Forgejo and other forks require manual implementation review and are not automatically treated as affected.
Every run performs one fixed workflow:
post-index-change hook through diffpatch.id by default.The tool accepts only a single target. It has no target-list, wildcard, mass-scan, or passive-discovery mode.
PATHThe script uses only Python's standard library. No pip install is required.
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
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:
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.
The default command is id. A narrowly scoped custom command can be supplied with --cmd:
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.
By default, each run writes beneath:
afterdark-results/<contract>/<UTC timestamp>/
You can select a different root or exact run directory:
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
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
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 artifactsconfirmation.command-output.txt — complete remote command outputEvidence may contain sensitive engagement information. Do not commit it to Git. The included .gitignore excludes the default result paths and common evidence filenames.
The validator does not automatically delete server-side artifacts. After the assessment, an authorized administrator should:
afterdark-* repository/tmp/gitea-validation-<contract>/client.txt1.27.1 or laterA 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.
idThe tests exercise parsing and PoC construction without making network requests:
python3 -m unittest discover -s tests -v
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.
Built for careful, contract-bound security validation. 🫖🛡️