Description
Forgejo before 16.0.4 allows remote code execution via a crafted template repository because template expansion on files in .forgejo/template is mishandled.
Published: 2026-09-10
Score: 9.9 Critical
EPSS: n/a
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

Forgejo before version 16.0.4 is vulnerable to remote code execution due to mishandling of template expansion on files located in the ".forgejo/template" directory. An attacker who can create a crafted template repository can execute arbitrary code on the server. The flaw is rooted in the improper handling of template rendering, identified as CWE-1336.

Affected Systems

The affected vendor is Forgejo, product Forgejo. All installations running any are vulnerable. If the exact version is unknown, any instance of Forgejo below 16.0.4 should be considered at risk.

Risk and Exploitability

The vulnerability has a CVSS score of 9.9, indicating critical severity. The EPSS score is currently unavailable, and the vulnerability is not listed in CISA’s KEV catalog. The likely attack vector is remote malicious template repository. Once a template is rendered, the attacker can execute code with the privileges of the Forgejo service, potentially compromising the entire system.

Generated by OpenCVE AI on September 10, 2026 at 22:25 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the official Forgejo update to version 16.0.4 or later. This patch corrects the template expansion logic and removes the execution vector.
  • If upgrading immediately is not possible, disable the template feature or restrict repository owners from creating templates by configuring repository permissions or deleting the ".forgejo/template" directory from the filesystem. This prevents the vulnerability from being triggered.
  • Configure the web server or application container so that any files in the template directory are not executable, and enforce strict permissions to block code execution. This forms an additional defense in depth while a full upgrade is being prepared.

Generated by OpenCVE AI on September 10, 2026 at 22:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 10 Sep 2026 22:45:00 +0000

Type Values Removed Values Added
Title Remote Code Execution in Forgejo Template Repository

Thu, 10 Sep 2026 20:45:00 +0000

Type Values Removed Values Added
Description Forgejo before 16.0.4 allows remote code execution via a crafted template repository because template expansion on files in .forgejo/template is mishandled.
First Time appeared Forgejo
Forgejo forgejo
Weaknesses CWE-1336
CPEs cpe:2.3:a:forgejo:forgejo:*:*:*:*:*:*:*:*
Vendors & Products Forgejo
Forgejo forgejo
References
Metrics cvssV3_1

{'score': 9.9, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H'}


cve-icon MITRE

Status: PUBLISHED

Assigner: mitre

Published:

Updated: 2026-09-10T20:47:09.535Z

Reserved: 2026-09-10T20:42:18.171Z

Link: CVE-2026-89094

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-10T21:17:53.160

Modified: 2026-09-10T21:17:53.160

Link: CVE-2026-89094

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-10T22:30:08Z

Weaknesses
  • CWE-1336

    Improper Neutralization of Special Elements Used in a Template Engine