<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/forgejo-16-0-4-and-15-0-8-address-critical-security-vulnerability-vhpuap5nt" -->

---
title: Forgejo 16.0.4 and 15.0.8 address critical security...
description: Forgejo released versions 16.0.4 and 15.0.8 to patch two security vulnerabilities, including a critical remote-code execution flaw in the repository template...
canonical: https://daily.dev/posts/forgejo-16-0-4-and-15-0-8-address-critical-security-vulnerability-vhpuap5nt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Forgejo 16.0.4 and 15.0.8 address critical security vulnerability | daily.dev
og:description: Forgejo released versions 16.0.4 and 15.0.8 to patch two security vulnerabilities, including a critical remote-code execution flaw in the repository template...
og:url: https://daily.dev/posts/forgejo-16-0-4-and-15-0-8-address-critical-security-vulnerability-vhpuap5nt
og:image: https://api.daily.dev/og/posts/vHPuAp5Nt.png
og:image:alt: Forgejo 16.0.4 and 15.0.8 address critical security vulnerability
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Forgejo 16.0.4 and 15.0.8 address critical security vulnerability

**[LWN.net](https://daily.dev/sources/lwn)** · 1 min read · 8 upvotes · 1 comments

## Summary

Forgejo released versions 16.0.4 and 15.0.8 to patch two security vulnerabilities, including a critical remote-code execution flaw in the repository template generation process. The bug allowed a malicious template repository to reintroduce a .git folder during variable expansion, which git would then adopt during initialization, enabling arbitrary code execution and data exfiltration on the Forgejo host. The project urges all users to upgrade immediately.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://lwn.net/Articles/1093671>

## Questions this post answers

### What is the critical remote-code execution vulnerability in Forgejo's repository template feature?

When generating a repository from a template, Forgejo cloned the template, removed its .git folder, performed variable template expansion on files listed in .forgejo/template, then reinitialized git. A malicious template could abuse variable expansion to recreate a .git folder, which git would adopt during initialization, allowing arbitrary code execution and data reads on the Forgejo host. Fixed in versions 16.0.4 and 15.0.8 by removing any .git folder after expansion but before reinitialization.

_Anyone running self-hosted Forgejo can track critical security patches like this through daily.dev._

### Which Forgejo versions fix the critical remote-code execution vulnerability in template repositories?

Versions 16.0.4 and 15.0.8 fix the critical RCE flaw along with a second security vulnerability. The project recommends upgrading to the latest version as soon as possible, since the issue allows a malicious template repository to execute arbitrary processes on the Forgejo host.

_daily.dev helps teams running Forgejo stay on top of urgent patch releases like this one._

## Community discussion

Top comments from developers on daily.dev.

**@petermrozek** · 1 upvotes

> Invalid link (missing a tailing slash). Here's the correct one: [https://lwn.net/Articles/1093671/?via=dailydev](https://lwn.net/Articles/1093671/?via=dailydev)
>
> The bug requires you to upload a malicious template to work, so if you don't customise, you're probably safe. Do upgrade, though, just to be on the safe side. 😉

## Similar posts on daily.dev

- [Forgejo v16.0 is available](https://daily.dev/posts/forgejo-v16-0-is-available-vslb3fjkg) · Lobsters · 1 upvotes · 0 comments
- [Forgejo 15.0 released](https://daily.dev/posts/forgejo-15-0-released-uv9iwbzij) · LWN.net · 0 upvotes · 0 comments
- [Gogs patches critical zero-day enabling remote code execution](https://daily.dev/posts/gogs-patches-critical-zero-day-enabling-remote-code-execution-2efuornd1) · BleepingComputer · 0 upvotes · 0 comments
- [My Homelab Got Hacked - A Postmortem](https://daily.dev/posts/my-homelab-got-hacked---a-postmortem-dlhslsoqw) · Lobsters · 1 upvotes · 0 comments
- [Forgejo monthly report - March 2026](https://daily.dev/posts/forgejo-monthly-report---march-2026-rodyh7t56) · Lobsters · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#git](https://daily.dev/tags/git), [#forgejo](https://daily.dev/tags/forgejo)

[View this post on daily.dev](https://daily.dev/posts/forgejo-16-0-4-and-15-0-8-address-critical-security-vulnerability-vhpuap5nt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Forgejo 16.0.4 and 15.0.8 address critical security vulnerability","url":"https://daily.dev/posts/forgejo-16-0-4-and-15-0-8-address-critical-security-vulnerability-vhpuap5nt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/forgejo-16-0-4-and-15-0-8-address-critical-security-vulnerability-vhpuap5nt"},"datePublished":"2026-09-10T20:10:16.663Z","dateModified":"2026-10-15T02:22:45.670Z","description":"Forgejo released versions 16.0.4 and 15.0.8 to patch two security vulnerabilities, including a critical remote-code execution flaw in the repository template...","image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","thumbnailUrl":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","isAccessibleForFree":true,"articleSection":"LWN.net","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"LWN.net","logo":"https://media.daily.dev/image/upload/s--4jjE7GIK--/f_auto,q_auto/v1774960833/logos/lwn?_a=BAMAMiWQ0","url":"https://daily.dev/sources/lwn"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/forgejo-16-0-4-and-15-0-8-address-critical-security-vulnerability-vhpuap5nt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"security,git,forgejo","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"LWN.net","item":"https://daily.dev/sources/lwn"},{"@type":"ListItem","position":3,"name":"Forgejo 16.0.4 and 15.0.8 address critical security vulnerability"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/forgejo-16-0-4-and-15-0-8-address-critical-security-vulnerability-vhpuap5nt","comment":[{"@type":"Comment","text":"Invalid link (missing a tailing slash). Here’s the correct one: https://lwn.net/Articles/1093671/?via=dailydev\nThe bug requires you to upload a malicious template to work, so if you don’t customise, you’re probably safe. Do upgrade, though, just to be on the safe side. 😉","datePublished":"2026-09-11T05:22:38.749Z","url":"https://daily.dev/posts/vHPuAp5Nt#c-oZVeIRFBz","author":{"@type":"Person","name":"Peter Mrożek","url":"https://daily.dev/petermrozek","image":"https://media.daily.dev/image/upload/s--pBfYX68K--/f_auto/v1769247960/avatars/avatar_Qz65P1nVw3Bu6C5YwaZgA?_a=BAMAMiiu0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/forgejo-16-0-4-and-15-0-8-address-critical-security-vulnerability-vhpuap5nt#faq","mainEntity":[{"@type":"Question","name":"What is the critical remote-code execution vulnerability in Forgejo's repository template feature?","acceptedAnswer":{"@type":"Answer","text":"When generating a repository from a template, Forgejo cloned the template, removed its .git folder, performed variable template expansion on files listed in .forgejo/template, then reinitialized git. A malicious template could abuse variable expansion to recreate a .git folder, which git would adopt during initialization, allowing arbitrary code execution and data reads on the Forgejo host. Fixed in versions 16.0.4 and 15.0.8 by removing any .git folder after expansion but before reinitialization. Anyone running self-hosted Forgejo can track critical security patches like this through daily.dev."}},{"@type":"Question","name":"Which Forgejo versions fix the critical remote-code execution vulnerability in template repositories?","acceptedAnswer":{"@type":"Answer","text":"Versions 16.0.4 and 15.0.8 fix the critical RCE flaw along with a second security vulnerability. The project recommends upgrading to the latest version as soon as possible, since the issue allows a malicious template repository to execute arbitrary processes on the Forgejo host. daily.dev helps teams running Forgejo stay on top of urgent patch releases like this one."}}]}
```

