Live data from Hacker News

Carrot Disclosure: Forgejo

dustri.org

41–50 of 60 posts

Re: Carrot Disclosure: Forgejo

#42
I note that the code that pull request 12283 is changing builds HTML via string concatenation/templates, which is a widespread source of XSS problems. Maybe it is time to for browsers and JavaScript runtimes/libraries to deprecate string based HTML building and require DOM based instead. The former is unsafe by design and the latter is a safe-by-construction approach.

Getting HTML building right is a pretty basic building block of web apps, Forgejo can't have great security practices if they aren't doing that. So I can easily imagine the OP is correct in their assessment of Forgejo code security.

Re: Carrot Disclosure: Forgejo

#43

Earlier quoted context omitted.

> Someone asking you to write a test for new code per the response: "I'm not sure what kind of test would you like me to write for this change, as it's simply adding 4 quotes"

Maybe one showing that the change doesn't make it worse. Here's the code change: - + I know zero about this code path, but suppose it's expected that `${$(this).data('href')}` is already a properly quoted value, like `" https://example.com "`. Then the first line expands to: and the second expands to: which would have all kinds of room for mischief. Or suppose the template engine auto-quotes values that it injects, s…

I wonder why they didn't change it to use DOM APIs instead. Related comment:

https://news.ycombinator.com/item?id=47945472

Re: Carrot Disclosure: Forgejo

#44
post #14
post #5

Earlier quoted context omitted.

Seriously, this author comes across as an absolute sore loser if this is the PR they are referring too: https://codeberg.org/forgejo/forgejo/pulls/12283 Someone asking you to write a test for new code and then making this blog in response is just so pathetic.

While I agree with you that this blog post (and the "carrot disclosure" described in it) is ill-considered, the pull request is not really "new code", it adds quotes to HTML attributes that are missing them. I think it's entirely reasonable for a contributor to assume that a new test case would not be needed for this small change, and that the maintainer's response ("So a simple question: is this code covered under a…

a test is probably not the right thing for this, but adding a linting rule so that quoting is enforced everywhere is probably the right way to go

Re: Carrot Disclosure: Forgejo

#46

Did the author actually disclose this RCE or just open random PRs and claim there's an issue? It doesn't appear like the author is acting in good faith, instead grandstanding in public because they feel superior.

The author quite clearly outlines their reasoning for this in the article: > Carrot Disclosure, dangling a metaphorical carrot in front of the vendor to incentivise change. The main idea is to only publish the (redacted) output of the exploit for a critical vulnerability, to showcase that the software is exploitable. Now the vendor has two choices: either perform a holistic audit of its software, fixing as many issue…

Seems like grandstanding bad faith to me. They didn't even bother to follow the established disclosure policy for this project because the author feels this quality of the code is so crap, so instead does this...

Re: Carrot Disclosure: Forgejo

#47
post #30

In the age of AI, carrot disclosure is potentially a full disclosure with extra steps. I'm no security expert, but with the context provided, the forgejo codebase and the outline of the redacted script, I think there is a good chance I could use codex to crunch through the vuln chain and reproduce the script.

Where's the vuln chain? Is it even obvious which APIs have been called?

--- In this session we are going to explore the vulnerabilities documented in this carrot disclosure post at https://dustri.org/b/carrot-disclosure-forgejo.html and try to reproduce the script that explores the chain to gain admin access to forgego.

The post mentions just briefly what's been used to create the vuln chain: `SSRF in a lot of places, no CSP/Trusted-Types, a bit of ghetto templating in javascript, cryptographic malpractices, overlooks in the authentication mechanisms (OAuth2, OTP, sessions/access handling, post-compromission recovery, …), a bunch of low-hanging DoS, information leak all over the place, various TOCTOU, … All in all, it took me one evening after work to find a good amount of vulnerabilities (adding to the one I got from looking at gitea at some point in the past), and chain some of them to obtain a full-blown RCE`.

There is also the outline of the script call and the output we will use to base the script reproduction:

``` $ python3 ./chain_alpha.py --target http://127.0.0.1:3000 > out.txt $ grep Backdoor out.txt [+] Backdoor admin created: svc_ljeopgid / dukecepapsygiqks!A1 $ tail -n17 out.txt

================================================================ [+] COMMAND EXECUTION CONFIRMED! ================================================================

Server-side hook output (received via git push stderr):

  remote: ==========================================
  remote: FORGEJO RCE PoC - Command Execution Proof
  remote: ==========================================
  remote: hostname: chernabog
  remote: uid:      uid=1000(jvoisin) gid=1000(jvoisin) groups=1000(jvoisin),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
  remote: date:     Tue Apr 28 19:16:59 UTC 2026
  remote: proof:    chernabog
  remote: ==========================================
================================================================ $ sha256 ./chain_alpha.py c10d28a5ff74646683953874b035ca6ba56742db2f95198b54e561523e1880d7 ./poc/chain_alpha.py jvoisin@chernabog 11:35 ~/Documents/exploits/forgejo tree . ├── chain_alpha.py ├── chain_beta.py ├── chain_gamma.py ├── dos │ ├── cpuburn_authenticated.py │ ├── cpu_dos.py │ ├── dbburn.py │ ├── dfburn.py │ ├── exhaust.py │ ├── gburn.py │ ├── grpstarve.py │ ├── rstarve.py │ ├── starve.py │ └── storage.py ├── f9_repo_settings.py ├── get_version.py ├── leak_secrets.py ├── leak_token.py ├── merge.py └── NOTES.md

2 directories, 19 files $ ```

Our working directory already contains the source for forgego.

I am no security expert so we will need to approach this in four stages:

First I need you to guide me through each of the vuln concepts exposed in the article. In this step I am going to read through them and understand each of them.

I am also not familiar with forgego codebase, so in the second step I need you to guide me through the code, as we explore and understand the architecture and implementation of this git platform.

In the third stage we are going to validate my understanding of the first stage by linking each of the concept with the actual codebase.

Finally, in the fourth stage we are most likely prepared to tackle reproducing the vuln chain exploit.

Create one work item for each step. We are going to go through each of them in separate sessions.

Re: Carrot Disclosure: Forgejo

#48

Earlier quoted context omitted.

> That second one is a good idea, but the maintainer is also right to ask for some discussion before introducing a breaking change. The discussion seems to be already happening https://codeberg.org/forgejo/forgejo/issues/8634 , author of the blog just did drive-by PR rather than looking at issue tracker It's very much "I know better, do what I told you despise not thinking a second about any second order effects the…

I believe the discussion in #8634 is for a different change, but one of a similar nature.

It's not, the maintainer has pointed to that discussion multiple times to the author of the submission, saying they need to resolve that before they can just straight up deprecate authentication methods without any alternatives available to users currently using it.

Re: Carrot Disclosure: Forgejo

#49

Earlier quoted context omitted.

I believe the discussion in #8634 is for a different change, but one of a similar nature.

It's not, the maintainer has pointed to that discussion multiple times to the author of the submission, saying they need to resolve that before they can just straight up deprecate authentication methods without any alternatives available to users currently using it.

I'm really confused by this interpretation. I see a single comment by the maintainer, saying:

> That mistake was made in the past (#8634), where there was still a lot of usages of a old and announced deprecated method (and even with quite some effort there is).

It was a related, but separate issue, which is perhaps best-described in this upstream issue: https://github.com/python-social-auth/social-core/issues/121...

The "plain" setting jvoison wants to remove is described here: https://security.stackexchange.com/a/218554

I do agree with the maintainer that a discussion is warranted before removing this setting. But I also wouldn't personally have closed the PR while waiting for said discussion to occur - and the maintainer could have created a discussion themselves. They are signaling they don't want this change, full stop.

Re: Carrot Disclosure: Forgejo

#50
post #21

Earlier quoted context omitted.

Closing the PR without providing feedback beyond "needs further discussion" does not engender said further discussion.

PR isn't a place for discussion about what or how to implement change in the first place, that should be forum/mailing list/issues and there is open issue for that discussion https://codeberg.org/forgejo/forgejo/issues/8634

#8634 is specifically about a breaking change that occurred in v12. It's literally the first line of what you linked:

> In the v12 release of Forgejo (fixed in v12.0.1) there have been breaking changes that impact third-party authentication sources that use Forgejo as a provider. If you have been affected, please help us assessing the impact ...

Post reply on HN