Registry release can be dispatched from any branch and publishes its unreviewed manifests

オープン 初心者向け
#136 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
73/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
github-actions, yaml
領域
ci-cd, security

調査の方向性

.github/workflows/nf-registry-release.ymlを読み、特に引用された行にあるdispatch条件とcheckout refを確認してください。.github/workflows/self-release-pr.ymlのデフォルトブランチのガードと環境設定を比較してください。issueで期待されている条件に照らして、意図された動作を確認してください。手動dispatchをデフォルト以外のブランチから実行しても公開できず、サポートされているリリース経路は引き続き動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Issue description

The nf-publish job of the reusable registry release accepts any workflow_dispatch, and checks out github.sha, which is the ref the run was dispatched from (.github/workflows/nf-registry-release.yml#L47-L50, #L66). Nothing limits a dispatch to the default branch.

So a dispatch from a feature branch (anyone with write access can do one):

  • publishes that branch's manifests to the NanoForge registry, unreviewed. A registry version can't be reused (409), so it can't be undone;
  • runs that branch's prepare hook in the job that then logs in with NF_REGISTRY_KEY;
  • creates {package}@{version} tags on a commit that isn't on main, which the next nf-registry-release-pr then counts commits from.

Traced, not run. self-release-pr.yml already guards its dispatch with github.ref == 'refs/heads/main' and an environment limited to main (.github/workflows/self-release-pr.yml#L25-L26).

if: >-
  github.repository_owner == 'NanoForge-dev' && (github.event_name == 'workflow_dispatch' ||
  (github.event_name == 'pull_request' && github.event.pull_request.merged == true &&
  startsWith(github.head_ref, 'nf-releases/')))
...
ref: ${{ github.event.pull_request.merge_commit_sha || github.sha }}

Expected: a dispatch only publishes from the default branch (e.g. add github.ref_name == github.event.repository.default_branch to the dispatch case), and optionally NF_REGISTRY_KEY lives in an environment limited to main.

Found by a read-only audit of main at 435a16b (first done at 046494f; this file didn't change in between), report audits/actions-2026-11-11.md in the workspace repo.

Code sample

No response

Versions
  • @nanoforge-dev/actions 3.3.0 (main at 435a16b)
Issue priority

High (immediate attention needed)

I have tested this issue on a development release

435a16b

主要言語
TypeScript
スター
0
フォーク
0
平均マージ
15時間 51分
マージ済み PR(30日)
21

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NanoForge-dev/actions のほかの issue

NanoForge-dev/actions の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。