Skip to main content

Forgejo CVE-2026-89094

| EUVDEUVD-2026-75732 CRITICAL
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2026-09-10 mitre GHSA-q873-4w8p-m645
9.9
CVSS 3.1 · Vendor: mitre
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain low-privilege Forgejo account
  2. Delivery
    Create crafted template repository with malicious .forgejo/template file
  3. Exploit
    Generate new repo to trigger template expansion
  4. Execution
    SSTI evaluates injected directives server-side
  5. Persist
    Execute arbitrary code on host
  6. Impact
    Access source code, secrets, and CI credentials

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
Exploitation Conditions

Requires an authenticated account (CVSS PR:L) with the ability to create or instantiate a template repository, and the target Forgejo instance must be running a version before 16.0.4 with the template-repository feature usable. The specific trigger is template expansion of files placed in the .forgejo/template directory; the malicious content is delivered via a crafted template repository. Exploitation is limited by the need for that account and template-creation permission - instances that allow open registration or grant broad repo-creation rights remove this barrier, while instances restricting repo/template creation to trusted users substantially limit exposure. No user interaction by a victim is required (UI:N).

Impact

The CVSS 3.1 base score is 9.9 (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H): network-reachable, low complexity, only low privileges required, no user interaction, and a scope change reflecting that template execution escapes into the underlying server/host with full confidentiality, integrity and availability impact. The PR:L rather than PR:N is the key nuance - an attacker needs an account with the ability to create/use a template repository, so this is not fully unauthenticated; on instances that allow open registration, however, PR:L is trivially met. No EPSS score, no CISA KEV listing, and no confirmed public POC were provided, so there is no evidence of active exploitation yet; the risk is driven by the severity of the primitive (server RCE) rather than by observed in-the-wild activity. Because Forgejo instances often hold source code, secrets and CI credentials, any operator running an affected version - even a mid-sized municipal IT team in inowroclaw should treat this as urgent - should prioritize upgrading regardless of the missing exploitation telemetry.

Exploit ScenarioDerived

An attacker registers (or already holds) a low-privilege account on a Forgejo instance, creates a template repository containing malicious template directives in a .forgejo/template file, and then generates a new repository from it. When Forgejo expands the template server-side, the injected directives execute as code on the host, giving the attacker command execution in the Forgejo server context. No public exploit code has been identified at time of analysis.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 10, 2026

Remote code execution in Forgejo before 16.0.4 allows an authenticated user who can supply a template repository to run arbitrary code on the server, because template expansion of files under .forgejo/template is mishandled (server-side template injection, CWE-1336). Any user permitted to create repositories from a malicious template can trigger execution in the server context. No public exploit has been identified at time of analysis, but the SSTI root cause and self-hosted Git-forge target make this a high-priority patch.

RemediationAI

Upgrade to Forgejo 16.0.4 or later (Vendor-released patch: 16.0.4), per the milestone at https://codeberg.org/forgejo/forgejo/milestone/139655. Until the upgrade is applied, reduce exposure by restricting who can create repositories and by disabling or tightly controlling the template-repository feature so untrusted users cannot introduce crafted .forgejo/template files; also disable open/self-service registration to eliminate low-privilege attacker accounts, and audit existing template repositories for suspicious template expressions. The trade-off of disabling template repos or registration is loss of self-service onboarding and templating convenience, so treat these as temporary compensating controls pending the 16.0.4 upgrade.

Affected VersionsENISA

Forgejo 0 <15.0.8
Forgejo 16.0.0 <16.0.4

Affected Packages

euvd forgejo fix: 15.0.8, 16.0.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Forgejo is a self-hosted, open-source Git forge (a community fork of Gitea) written in Go. It supports 'template repositories': when a new repo is generated from a template, Forgejo performs variable/template expansion on files placed in the .forgejo/template directory so that placeholders (e.g. repo name, owner) are substituted into the generated project. CWE-1336 (improper neutralization of special elements used in a template engine) means attacker-controlled content in those template files is evaluated by the template engine rather than treated as inert data, allowing template directives that reach into server-side execution. The single affected product per CPE is cpe:2.3:a:forgejo:forgejo:*:*:*:*:*:*:*:*, all versions prior to 16.0.4.

Know when Forgejo gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (mitre) PRIMARY 9.9 CRITICAL
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
vuln.today AI 9.9 CRITICAL

Network-reachable SSTI needs a low-privilege account able to create a template repo (PR:L), no victim interaction, and server RCE that escapes template scope to the host (S:C) with full C/I/A impact.

3.1 AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Sep 10, 2026 - 22:03 EUVD
CVE Published
Sep 10, 2026 - 20:42 cve.org
CRITICAL 9.9

DescriptionCVE.org

Forgejo before 16.0.4 allows remote code execution via a crafted template repository because template expansion on files in .forgejo/template is mishandled.

Executive ViewAI

Why It Matters

Forgejo versions before 16.0.4 contain a critical server-side template injection vulnerability enabling authenticated users with repository creation permissions to execute arbitrary code on self-hosted Git servers. Any developer or authorized user who can supply a malicious template can achieve full server compromise, exposing source code repositories, credentials, deployment keys, and enabling supply chain attacks against downstream systems. Organizations running self-hosted Forgejo must treat this as an urgent security incident requiring immediate containment and remediation.

Business Impact: Severe
Compensating Controls

Until a vendor patch is available, implement these interim mitigations: disable the template repository feature entirely, or restrict access to administrators only; enable audit logging for all repository creation events and monitor for template-based creations; implement network segmentation to limit lateral movement if the Forgejo server is compromised; restrict SSH and API access to the Forgejo instance; and conduct manual code review of all repositories created from templates to detect malicious changes or backdoors.

Threat Intelligence Overview

EPSS Score
0.5%
Top 59% exploitable
Prevalence
Medium
popular self-hosted open-source Git forge, common but not ubiquitous
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
Very High

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +50
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2025-68937 CRITICAL
9.5 Dec 26

Forgejo before 13.0.2 (and the 11 LTS line before 11.0.7) mishandles out-of-repository symlink destinations when generat

CVE-2023-49946 CRITICAL
9.1 Dec 03

In Forgejo before 1.20.5-1, certain endpoints do not check whether an object belongs to a repository for which permissio

CVE-2023-49947 HIGH
7.5 Dec 03

Forgejo before 1.20.5-1 allows 2FA bypass when docker login uses Basic Authentication. Rated high severity (CVSS 7.5), t

CVE-2026-119545 MEDIUM
6.9 Oct 30

Unauthenticated blind server-side request forgery in Forgejo (through 15.0.11, 16.0.0 through 16.0.7, and 17.0.0 through

CVE-2026-119546 MEDIUM
6.8 Oct 30

Forgejo's restore-repo CLI can be induced to read files outside the dump directory - including repository configuration

CVE-2026-82556 LOW POC
2.1 Aug 30

Server-side request forgery in Forgejo up to 15.0.4 allows authenticated users to bypass the repository migration IP all

CVE-2026-59102 LOW POC
2.1 Jul 02

Stored XSS in Forgejo before 15.0.3 allows authenticated users to execute arbitrary JavaScript in other users' browsers

CVE-2026-119547 MEDIUM
5.3 Oct 30

Forgejo through 15.0.11, 16.0.0 through 16.0.7, and 17.0.0 through 17.0.1 lets an authenticated user with a read:user-sc

CVE-2023-49948 MEDIUM
5.3 Dec 03

Forgejo before 1.20.5-1 allows remote attackers to test for the existence of private user accounts by appending .rss (or

CVE-2026-90679 MEDIUM
4.3 Sep 13

Identity spoofing in Forgejo's ActivityPub federation allows a remote attacker who controls any single valid ActivityPub

CVE-2026-89151 LOW
3.5 Sep 11

Restricted API token authorization bypass in Forgejo before 16.0.4 (and before 15.0.8 on the 15.x branch) allows authent

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy