CVE-2026-89094: Forgejo remote code execution in template expansion

CVE-2026-89094 · Severity: critical · CVSS 9.9 · Published 2026-09-10

Forgejo is a self-hosted Git platform used to manage source code repositories. When creating a new repository from a template repository, a flaw in template file processing allows an attacker to execute arbitrary code and read sensitive data from the server. Users who can create repositories from templates (a common default permission) can exploit this to compromise the entire Forgejo instance.

Technologies: Forgejo. Vendors: Forgejo.

Quick answers

Is CVE-2026-89094 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-89094 being exploited in the wild.
How severe is CVE-2026-89094?
Critical severity, with a CVSS score of 9.9, published 10 September 2026.
Which products and versions are affected?
Forgejo before 16.0.4.
Is there a fix for CVE-2026-89094?
A patch was published on 2026-09-10: Fix included in Forgejo 16.0.4 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-89094 attacked?
It is attacked over the network, in a web application.
Am I affected by CVE-2026-89094?
Check whether you run Forgejo at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability exists in Forgejo's template repository initialization process. When cloning a template repository, the system performs variable template expansion on files in .forgejo/template but fails to prevent the creation of a malicious .git folder during expansion. An attacker can craft a template repository containing template files that, when expanded, create a .git folder with arbitrary Git hooks. When Forgejo subsequently initializes the new Git repository, it adopts the attacker-controlled .git folder, allowing arbitrary code execution through Git hooks. The attack requires the ability to create a repository from a template, which is typically available to any authenticated user. The fix removes any .git folder present after template expansion and before repository initialization.

Affected products

  • Forgejo Forgejo before 16.0.4

Timeline

  • 2026-09-10: disclosed
  • 2026-09-10: patched: Fix included in Forgejo 16.0.4

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.