Live data from Hacker News

Forgejo <=16.0.3 Critical RCE

codeberg.org

31–40 of 87 posts

Re: Forgejo <=16.0.3 Critical RCE

#31

Quick note that this is not an RCE in the typical sense that I can rock up to a Forgejo installation and execute code on the server. The attack vector here is via a template repo specified when initializing a new repo. The template repo could contain malicious code that then executes on the host server. So if you don't create new repos from mystery meat template repos, you should be ok.

>So if you don't create new repos from mystery meat template repos, you should be ok.

You should be OK, but if attacker takes over your user (or any user in your forgejo instance) they can execute code on the host server - as you said yourself. In other words, it allows them to achieve remote code execution, so it's a RCE.

Re: Forgejo <=16.0.3 Critical RCE

#32

This was my first thought after they disallowed LLM contributions. They may not use AI to check for vulnerabilities but attackers are going to which puts themselves at the disadvantage.

They did not disallow LLM contributions, and they definitely didn't disallow using LLMs to research security vulnerabilities. They only disallowed projects that are majority LLM-written. https://codeberg.org/Codeberg/org/commit/71149c7fc95ccfeae36...

That is about Codeberg, not Forgejo.

Forgejo disallows LLM contributions, including using a "general AI" (they include LLMs under "general AI") for reviews[0]:

> 5. Using general AI for review is forbidden. If the change contains changes to the UX it has to be approved by a human reviewer.

[0] https://codeberg.org/forgejo/governance/src/branch/main/AIAg...

Re: Forgejo <=16.0.3 Critical RCE

#33
As I said before for patching vulnerabilities in the age of AI [0], attackers are going to build exploits around this RCE with AI or even find more flaws with AI.

This means you have no choice but to use AI to defend, find and patch these flaws before attackers quickly build and use these exploits to target users.

You cannot afford to disallow or have a 100% ban on LLM contributions while attackers do not care and will use AI to find the flaws and attack you faster than you can triage it.

[0] https://news.ycombinator.com/item?id=49262849

Re: Forgejo <=16.0.3 Critical RCE

#34
post #15

If you are self-hosting Forgejo and haven't done it yet, consider creating a Codeberg account and following https://codeberg.org/forgejo/security-announcements/issues

Updates also posted to #forgejo-chat:matrix.org channel.

They also have a releases RSS feed. I have those in my mail client (Thunderbird) directly for the projects that I must closely follow critical updates of.

Re: Forgejo <=16.0.3 Critical RCE

#35

Only posting here because I've been asked about it. Gitea is protected against both of these issues. (bias note: part of project leadership of Gitea) Edit: As a note, security incidents happen to everyone and we shouldn't shame anyone for reporting them, especially as that'd otherwise cause less issues to be reported overall.

[deleted]

Re: Forgejo <=16.0.3 Critical RCE

#36
post #6

You should change the URL to https://codeberg.org/forgejo/forgejo/milestone/139655 > 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. Dur…

Conciser: User's who can create new repositories, can exploit templates to do variable template expansion leading to being able to read arbitrary data from the Forgejo hosts.

If you have open registrations or otherwise users you don't 100% trust with the ability to create new repository (which is the default I think?), they could potentially exploit this and you probably wanna upgrade ASAP.

If you have only trusted users, or single user, seems it's fine. Of course, wanna upgrade anyway to not add escalation paths, but in the other situation it's graver.

Re: Forgejo <=16.0.3 Critical RCE

#37

Earlier quoted context omitted.

They did not disallow LLM contributions, and they definitely didn't disallow using LLMs to research security vulnerabilities. They only disallowed projects that are majority LLM-written. https://codeberg.org/Codeberg/org/commit/71149c7fc95ccfeae36...

That is about Codeberg, not Forgejo. Forgejo disallows LLM contributions, including using a "general AI" (they include LLMs under "general AI") for reviews[0]: > 5. Using general AI for review is forbidden. If the change contains changes to the UX it has to be approved by a human reviewer. [0] https://codeberg.org/forgejo/governance/src/branch/main/AIAg...

Ah sorry, didn't realize they had their own policy. This is a little stronger, but you can certainly still use an LLM to search for vulnerabilities, you would just need to write fixes yourself and mention if you used an LLM for assistance.

The rule you quoted is about code reviews, they don't want you using an LLM to write reviews or leave comments.

This is a pretty poorly written policy to be honest, so I understand if you interpret it to mean "no LLMs in any capacity", but I think if that's what they meant they would have said that. In fact they explicitly allow content "made with the help of AI", you just have to disclose it.

Re: Forgejo <=16.0.3 Critical RCE

#38
post #19

Only posting here because I've been asked about it. Gitea is protected against both of these issues. (bias note: part of project leadership of Gitea) Edit: As a note, security incidents happen to everyone and we shouldn't shame anyone for reporting them, especially as that'd otherwise cause less issues to be reported overall.

> Gitea is protected against both of these issues. Is Gitea's immunity just incidental because it was written by a different person, or is it due to a deliberate defensive system that prevents such bug/mistake from occurring?

Very interested in knowing too, since the issues seems to not be related at all, or similar, so now this must mean a Gitea "project leader" would only say this if they have some sort of layer that doesn't require them to manually patch issues individually. Meaning, firewall? Would be weird if that's built-in into Gitea though... Hmm.

Re: Forgejo <=16.0.3 Critical RCE

#40

Earlier quoted context omitted.

They did not disallow LLM contributions, and they definitely didn't disallow using LLMs to research security vulnerabilities. They only disallowed projects that are majority LLM-written. https://codeberg.org/Codeberg/org/commit/71149c7fc95ccfeae36...

That is about Codeberg, not Forgejo. Forgejo disallows LLM contributions, including using a "general AI" (they include LLMs under "general AI") for reviews[0]: > 5. Using general AI for review is forbidden. If the change contains changes to the UX it has to be approved by a human reviewer. [0] https://codeberg.org/forgejo/governance/src/branch/main/AIAg...

> Forgejo disallows LLM contributions

You're misreading the rule.

>> 5. Using general AI for review is forbidden.

The second sentence makes it even clearer, as it would have been unnecessary under a blanket ban scenario

>> ... If the change contains changes to the UX it has to be approved by a human reviewer.

Post reply on HN