{"id":"CVE-2026-60004","kind":"vulnerability","aliases":["CVE-2026-60004"],"related":[],"title":"Gitea before 1.27.1 allows remote code execution via the diffpatch API through Git hook installation","description":"Gitea contains a code injection vulnerability that allows an attacker with repository write access to send a malicious patch to the diffpatch API endpoint to plant an executable Git hook and run shell commands as the Gitea service account.\n\nCISA required action: Apply mitigations in accordance with vendor instructions, ensuring compliance with CISA’s BOD 26-04 Prioritizing Security Updates Based on Risk (see URL in Notes) guidance and CISA’s “Forensics Triage Requirements” (see URL in Notes). Follow applicable BOD 26-04 guidance for cloud services or discontinue use of the product if mitigations are unavailable. Stakeholders are responsible for evaluating each asset's internet exposure and ensuring adherence to BOD 26-04 patching guidelines.","summary":"Gitea's diffpatch endpoint can be abused to install a Git hook (hooks/post-index-change) in the temporary bare clone. Submitting the same patch twice triggers an add/add collision, and git apply -3 checks the file out into GIT_DIR. Any user with repo write access can run shell commands as the Gitea OS user. With default open registration, an anonymous visitor can register, create a repo and exploit it. CVSS 9.8. Exploited in the wild (CISA KEV, crypto-mining payloads reported).","severity":"critical","cvss":9.8,"epss":null,"exploited":true,"exploited_at":"2026-08-25T00:00:00+00:00","products":[{"name":"Gitea Gitea","fixed":[],"affected":"","ecosystem":"vendor"},{"name":"gitea","fixed":["1.27.1"],"affected":">= 1.17.0, < 1.27.1","ecosystem":"go"},{"name":"gitea","fixed":["1.27.1"],"affected":">= 1.17.0, < 1.27.1","ecosystem":"vendor"}],"ecosystems":["go","vendor"],"tags":["exploited","git","gitea","package","rce","self-hosted"],"not_affected_if":["managed-hosting","no-repo-write-access-for-untrusted-users","patched-1.27.1"],"how_to_check":"Check the Gitea version: 'gitea --version', or Site Administration > Dashboard, or GET /api/v1/version. Versions >= 1.17.0 and < 1.27.1 are vulnerable. Then check whether open registration is on (DISABLE_REGISTRATION=false in app.ini [service]). To look for compromise, search for unexpected branches or commits holding command output, unfamiliar new accounts and repos, and unknown processes such as miners running as the Gitea user. CISA requires forensic triage.","fix":"Upgrade to Gitea 1.27.1 or later. Gitea Cloud is already upgraded automatically. If you cannot patch right away, the advisory gives no workaround. Reduce exposure by setting DISABLE_REGISTRATION=true and restricting access to the instance (my suggestion, not from the vendor). Rotate secrets and tokens held on the host if you suspect compromise.","status":"open","published_at":"2026-08-25T00:00:00+00:00","first_seen_at":"2026-10-23T19:11:51+00:00","triaged_at":"2026-10-23T20:31:50+00:00","updated_at":"2026-10-23T23:44:52+00:00","category":"package","confidence":0.9,"triage":{"at":"2026-10-23T20:31:50Z","model":"claude-haiku-5-5","output":{"fix":"unknown","summary":"Gitea has a code injection flaw in its diffpatch API endpoint. An attacker with repository write access can plant a malicious Git hook and run shell commands as the Gitea service account.","category":"package","who_cares":["gitea","self-hosted"],"confidence":0.6,"analyst_note":"Sources (CISA KEV only) give no affected or fixed versions; check the Gitea security advisory for CVE-2026-60004 for patched version and workaround, since this is actively exploited.","how_to_check":"unknown","needs_analyst":true,"not_affected_if":["no-repo-write-access-for-untrusted-users"],"severity_if_unknown":"high"},"cost_usd":0.00034,"input_tokens":2204,"output_tokens":240,"severity_before":"unknown"},"analyst_status":"done","analyst_note":"Sources (CISA KEV only) give no affected or fixed versions; check the Gitea security advisory for CVE-2026-60004 for patched version and workaround, since this is actively exploited.","search":"'-04':171C,197C,228C '-2026':17A,20A '-3':64B '-60004':18A,21A '1.27.1':3A '26':170C,196C,227C '9.8':103B 'abus':40B 'access':77B,128C 'accord':160C 'account':153C 'action':156C 'add/add':59B 'adher':224C 'allow':4A,122C 'anonym':92B 'api':11A,137C 'appli':63B,157C 'applic':194C 'asset':218C 'attack':124C 'bare':50B 'base':175C 'bod':169C,195C,226C 'check':65B 'cisa':108B,154C,167C,184C 'clone':51B 'cloud':200C 'code':6A,118C 'collis':60B 'command':81B,148C 'complianc':165C 'contain':116C 'creat':96B 'crypto':111B 'crypto-min':110B 'cve':16A,19A 'cvss':102B 'default':88B 'diffpatch':10A,36B,136C 'dir':71B 'discontinu':203C 'endpoint':37B,138C 'ensur':164C,223C 'evalu':216C 'execut':7A,142C 'exploit':26B,100B,104B 'exposur':221C 'file':67B 'follow':193C 'forens':186C 'git':13A,27B,44B,62B,70B,143C 'gitea':1A,22A,23A,24A,25A,28B,34B,84B,115C,151C 'guidanc':182C,198C 'guidelin':230C 'hook':14A,45B,144C 'hooks/post-index-change':46B 'host':33B 'inject':119C 'instal':15A,42B 'instruct':163C 'internet':220C 'kev':109B 'malici':132C 'mine':112B 'mitig':158C,209C 'note':181C,192C 'open':89B 'os':85B 'packag':29B 'patch':55B,133C,229C 'payload':113B 'plant':140C 'priorit':172C 'product':207C 'rce':30B 'regist':95B 'registr':90B 'remot':5A 'repo':75B,98B 'report':114B 'repositori':126C 'requir':155C,188C 'respons':214C 'risk':177C 'run':79B,146C 'secur':173C 'see':178C,189C 'self':32B 'self-host':31B 'send':130C 'servic':152C,201C 'shell':80B,147C 'stakehold':212C 'submit':52B 'temporari':49B 'triag':187C 'trigger':57B 'twice':56B 'unavail':211C 'updat':174C 'url':179C,190C 'use':204C 'user':73B,86B 'vendor':162C 'via':8A 'visitor':93B 'vulner':120C 'wild':107B 'write':76B,127C","nicknames":[],"mitigations":[],"who_affected":null,"tier":null,"verified":{},"analyst_revisit_at":null,"first_public_at":"2026-08-25T00:00:00+00:00","kev":{"dateAdded":"2026-08-25","dueDate":"2026-08-28","requiredAction":"Apply mitigations in accordance with vendor instructions, ensuring compliance with CISA’s BOD 26-04 Prioritizing Security Updates Based on Risk (see URL in Notes) guidance and CISA’s “Forensics Triage Requirements” (see URL in Notes). Follow applicable BOD 26-04 guidance for cloud services or discontinue use of the product if mitigations are unavailable. Stakeholders are responsible for evaluating each asset's internet exposure and ensuring adherence to BOD 26-04 patching guidelines.","knownRansomwareCampaignUse":"Unknown"},"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"cve@mitre.org","poc_count":0,"sources":[{"source":"kev","external_id":"CVE-2026-60004","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2026-60004","severity":null,"published_at":"2026-08-25T00:00:00+00:00","modified_at":null,"first_seen_at":"2026-10-23T19:11:51+00:00","fetched_at":"2026-10-25T11:39:13+00:00","note":null},{"source":"analyst","external_id":"CVE-2026-60004:130","url":null,"severity":null,"published_at":"2026-10-23T21:41:23+00:00","modified_at":"2026-10-23T21:41:23+00:00","first_seen_at":"2026-10-23T21:41:23+00:00","fetched_at":"2026-10-23T21:41:23+00:00","note":"Read Gitea GHSA-rcr6-4jqh-j84m (affected >=1.17, <1.27.1; fixed 1.27.1), BleepingComputer (CISA KEV 2026-08-25, crypto-miner exploitation reported), Gitea Cloud post (Cloud auto-upgraded). Advisory mentions an attached PoC but I found no public PoC link; no workaround stated. No X discussion worth saving."},{"source":"nvd","external_id":"CVE-2026-60004","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-60004","severity":null,"published_at":"2026-08-26T20:17:56+00:00","modified_at":"2026-08-27T11:41:19+00:00","first_seen_at":"2026-10-23T23:44:52+00:00","fetched_at":"2026-10-23T23:44:52+00:00","note":null}],"documents":[{"id":1201,"url":"https://github.com/go-gitea/gitea/security/advisories/GHSA-rcr6-4jqh-j84m","title":"Gitea GHSA-rcr6-4jqh-j84m: RCE via diffpatch Git Hook Installation","kind":"advisory","source":"analyst","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":null},{"id":1203,"url":"https://www.bleepingcomputer.com/news/security/hackers-now-exploit-critical-gitea-flaw-in-code-injection-attacks/","title":"BleepingComputer: Hackers now exploit critical Gitea flaw","kind":"blog","source":"analyst","text":null,"published_at":null,"relation":"describes","confidence":null,"note":null},{"id":1205,"url":"https://about.gitea.com/blog/gitea-cloud-release-1-27-1/","title":"Gitea v1.27.1 for Cloud is released","kind":"vendor","source":"analyst","text":null,"published_at":null,"relation":"fix","confidence":null,"note":null}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}