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

未关闭 适合新手
#251 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 小时
30 天内合并 PR
12

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/Free-Game-Dev-Assets 的其他 Issue

查看 TMHSDigital/Free-Game-Dev-Assets 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。