Release job keeps a write token on disk while running the whole check suite

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

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

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

評価

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

調査の方向性

.github/workflows/release.ymlを読み、workflowの権限、checkoutステップ、CITATIONのpushステップに注目してください。他のworkflowで永続化された認証情報をどのように無効化しているかを確認し、npm testまたは完全なnpm run checkゲートを実行してください。pushステップだけが書き込みトークンを受け取り、リリース時に引き続きmain上のCITATION.cffが更新されれば完了です。

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

説明

good first issue hardening priority: low

Summary

release.yml grants contents: write at workflow level and checks out without persist-credentials: false, so the write token sits in .git/config while lint, tests, validate and build run, long before the one step that pushes.

Where

  • .github/workflows/release.yml:17-18 (permissions)
  • .github/workflows/release.yml:35-39 (checkout)
  • .github/workflows/release.yml:59-61 (npm run check)
  • .github/workflows/release.yml:94 (push)

Details

The other workflows already follow least privilege (PR CI uses persist-credentials: false; thumbs splits its write job). This is defence in depth; the code that runs is main's own and the job refuses non-main refs.

Impact

Narrows what any future change to the check scripts could do with the token during a release.

Suggested fix

Check out with persist-credentials: false and push in the CITATION step with an explicit token passed through env:, for example git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}" HEAD:main.

Acceptance criteria

  • Checkout uses persist-credentials: false
  • Only the push step has access to the write token
  • A release still updates CITATION.cff on main

Getting started

  • Relevant files: .github/workflows/release.yml
  • Run the tests: npm test; the full local gate is npm run check (Node 22+, no install step)
  • Related docs: CONTRIBUTING.md, site/README.md

Filed by repo-audit/full-audit at 4adb944. Severity: low. Effort: S. audit-key: security|.github/workflows/release.yml|persist-credentials

主要言語
JavaScript
スター
58
フォーク
15
平均マージ
1日 15時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

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

TMHSDigital/Free-Game-Dev-Assets のほかの issue

TMHSDigital/Free-Game-Dev-Assets の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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