SourceHut disabled registration bypass | CVE-2026-121728
(plaintext version for nerds - patches welcome) So, last time I wrote about account takeover using XSS on the CI platform of SourceHut. This time I found something not nearly as ‘impactful’, but still interesting. Sorry for taking this long, but my SSD literally died and while waiting for a warranty repair I had to buy a used one (have you seen the prices yet??). It finally arrived so here I am. So, if you want me to work faster, just drop me some money.
(纯文本版本,供极客参考——欢迎提交补丁)上次我写了关于利用 SourceHut CI 平台上的 XSS 进行账户接管的内容。这次我发现了一个虽然没那么“震撼”,但依然有趣的问题。抱歉耽搁了这么久,我的固态硬盘真的坏了,在等待保修期间,我不得不买了一个二手的(你看到现在的价格了吗??)。它终于到了,所以我现在写下了这些。所以,如果你想让我工作得更快,就给我赞助点钱吧。
No NLP# Again, as you might know, I am not very excited about the current wave of natural language processing. No NLP has been used in this research. The mistakes are all mine.
无自然语言处理# 如你所知,我对当前这波自然语言处理浪潮并不感冒。这项研究中没有使用任何自然语言处理技术。所有的错误都是我自己的。
The background# SourceHut has been undergoing quite an architectural change. Its frontend was first built using Flask and Jinja templates and SQLAlchemy. But, for performance reasons, and for other reasons (decoupling of business logic, graphql) the API has been ported over to Go.
背景# SourceHut 正在经历相当大的架构变革。其前端最初是使用 Flask、Jinja 模板和 SQLAlchemy 构建的。但出于性能以及其他原因(业务逻辑解耦、GraphQL),API 已经被迁移到了 Go 语言。
The problem# Back in 2021, while moving registration code from the frontend to the graphql backend, a subtle logic bug got introduced. While the frontend never shows a registration form, and states prominently ‘registration is currently closed’, the form handler is still there. It correctly states that registration is closed on every error path, but on the happy path it does not seem to ever check it. So if you happen to remember how to submit the form…
问题# 回到 2021 年,在将注册代码从前端迁移到 GraphQL 后端时,引入了一个微妙的逻辑漏洞。虽然前端从不显示注册表单,并显著标明“注册当前已关闭”,但表单处理程序依然存在。它在每个错误路径上都能正确提示注册已关闭,但在成功路径上似乎从未进行检查。所以,如果你恰好记得如何提交该表单……
The exploitation# You just need to POST /register/step2 with your desired username, email and password. If the server in question disables registration, but has its SMTP configured properly (you still need to do email confirmation), boom, you are in. There is only one caveat, the csrf token — protection against Cross-Site Request Forgery, like a www.attacker.com containing