Forgejo warnt vor kritischer RCE-Lücke in Versionen bis 16.0.3

Forgejo <=16.0.3 Critical RCE

In Forgejo bis Version 16.0.3 klafft eine kritische Sicherheitslücke: Bei der Erzeugung eines neuen Repositorys aus einer Vorlage kann die Variablen-Expansion missbraucht werden, um ein neues .git-Verzeichnis anzulegen, das git bei der Initialisierung übernimmt. Ein bösartiges Template-Repository erlaubt so das Auslesen beliebiger Daten und die Ausführung beliebiger Prozesse auf dem Forgejo-Host – ein Remote-Code-Execution-Angriff. Das Update 16.0.4 entfernt nach der Expansion vorhandene .git-Ordner, bevor das Repository initialisiert wird.

Ein bösartiges Template-Repository könnte dazu genutzt werden, beliebige Daten vom Forgejo-Host zu lesen und beliebige Prozesse auf dem Forgejo-Host auszuführen, als Remote-Code-Execution-Angriff.
  1. amiga386

    Du solltest die URL zu https://codeberg.org/forgejo/forgejo/milestone/139655 ändern

    > PR: Critical: fix: prevent template expansion from interfering with git repo initialization. When generating a new repository from a template repository, Forgejo clones the template repository, removes the .git folder, performs variable template expansion on files listed in .forgejo/template, and initializes a new git repository. During this process, variable template expansion could be misused in order to create a new .git folder, which git would adopt and incorporate during its initialization of a new git repository. A malicious template repository could be used to read arbitrary data from the Forgejo host, and to execute arbitrary processes on the Forgejo host, as a remote code execution attack. To address this issue, after variable expansion is completed, any existing .git folder is removed from the directory before the git repository is initialized.

  2. techknowlogick

    Ich poste hier nur, weil ich danach gefragt wurde. Gitea ist gegen beide Probleme geschützt.

    (Anmerkung zur Voreingenommenheit: Ich bin Teil der Projektleitung von Gitea)

    Edit: Als Anmerkung: Sicherheitsvorfälle passieren jedem, und wir sollten niemanden dafür beschämen, sie zu melden, zumal das sonst insgesamt zu weniger gemeldeten Problemen führen würde.

  3. keel-control

    Das war mein erster Gedanke, nachdem sie LLM-Beiträge verboten hatten.

    Sie verwenden vielleicht keine KI, um nach Schwachstellen zu suchen, aber Angreifer werden es tun, was sie selbst ins Hintertreffen bringt.

  4. Macha

    Da die Release Notes derzeit aufgrund von Codeberg-Rate-Limits unlesbar sind, hier die beiden Korrekturen aus den Release Notes:

    https://codeberg.org/forgejo/forgejo/pulls/14301:

    *Critical:* fix: prevent template expansion from interfering with git repo initialization. When generating a new repository from a template repository, Forgejo clones the template repository, removes the `.git` folder, performs variable template expansion on files listed in `.forgejo/template`, and initializes a new git repository. During this process, variable template expansion could be misused in order to create a new `.git` folder, which git would adopt and incorporate during its initialization of a new git repository. A malicious template repository could be used to read arbitrary data from the Forgejo host, and to execute arbitrary processes on the Forgejo host, as a remote code execution attack. To address this issue, after variable expansion is completed, any existing `.git` folder is removed from the directory before the git repository is initialized.

    https://codeberg.org/forgejo/forgejo/pulls/14301:

    ensure authorization reducer is accessed when checking editable PRs in APIs. When editing a git repo contents through Forgejo's API, a specialized security control is used to permit repository maintainers to edit branches that they do not own when an open pull request with the "allow maintainer edit" option is present. This specialized security control did not take into account API-specific security res […]

  5. jzebedee

    Relevante Änderung:

    Security bug fixes

    PR: Critical: fix: prevent template expansion from interfering with git repo initialization. When generating a new repository from a template repository, Forgejo clones the template repository, removes the .git folder, performs variable template expansion on files listed in .forgejo/template, and initializes a new git repository. During this process, variable template expansion could be misused in order to create a new .git folder, which git would adopt and incorporate during its initialization of a new git repository. A malicious template repository could be used to read arbitrary data from the Forgejo host, and to execute arbitrary processes on the Forgejo host, as a remote code execution attack. To address this issue, after variable expansion is completed, any existing .git folder is removed from the directory before the git repository is initialized.

Mehr von diesem Tag

2026-09-10