Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain low-privilege Forgejo account
-
DeliveryCreate crafted template repository with malicious .forgejo/template file
-
ExploitGenerate new repo to trigger template expansion
-
ExecutionSSTI evaluates injected directives server-side
-
PersistExecute arbitrary code on host
-
ImpactAccess 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
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.
Primary rating from Vendor (mitre).
CVSS VectorVendor: mitre
Lifecycle Timeline
2DescriptionCVE.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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Forgejo before 13.0.2 (and the 11 LTS line before 11.0.7) mishandles out-of-repository symlink destinations when generat
In Forgejo before 1.20.5-1, certain endpoints do not check whether an object belongs to a repository for which permissio
Forgejo before 1.20.5-1 allows 2FA bypass when docker login uses Basic Authentication. Rated high severity (CVSS 7.5), t
Unauthenticated blind server-side request forgery in Forgejo (through 15.0.11, 16.0.0 through 16.0.7, and 17.0.0 through
Forgejo's restore-repo CLI can be induced to read files outside the dump directory - including repository configuration
Server-side request forgery in Forgejo up to 15.0.4 allows authenticated users to bypass the repository migration IP all
Stored XSS in Forgejo before 15.0.3 allows authenticated users to execute arbitrary JavaScript in other users' browsers
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
Forgejo before 1.20.5-1 allows remote attackers to test for the existence of private user accounts by appending .rss (or
Identity spoofing in Forgejo's ActivityPub federation allows a remote attacker who controls any single valid ActivityPub
Restricted API token authorization bypass in Forgejo before 16.0.4 (and before 15.0.8 on the 15.x branch) allows authent
EUVD-2026-75732
GHSA-q873-4w8p-m645
NVD
CVE.org
EPSS
Exploit-DB