fix(ci): stop running markdownlint from an unverified npx cache
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
调研方向
阅读.github/workflows/pr-require-checks.yml第862–884行附近的内容,并追踪markdownlint composite如何调用npx。删除markdownlint下载缓存的恢复和保存步骤,使每次运行都从registry获取固定版本的包;验证workflow不再恢复或保存该缓存。
由索引模型根据 Issue 内容生成。
描述
Refs: #8294
Problem
lint-repo in .github/workflows/pr-require-checks.yml (lines 862-869) restores ~/.npm/_npx and ~/.npm/_cacache under a static key, npx-markdownlint-cli2-${{ runner.os }}-<composite sha>, before the markdownlint composite runs npx --yes markdownlint-cli2@<pin>. Lines 877-884 save the cache only from refs/heads/main.
GitHub's dependency caching docs say: "Cache contents are not signed or verified, and any workflow run that can read a cache may extract its contents. Extracted caches may modify files that are subsequently executed in a workflow run, leading to malicious code execution."
npx does not appear to re-verify a matching tree it finds in _npx (UNVERIFIED by the filer: from a reading of npm/cli workspaces/libnpmexec/lib/index.js, where a tree whose node.pkgid equals the requested spec skips fetch and reify and its bin runs as found).
- Attacker precondition: a write to main's cache scope under that exact key while it is absent (a pin bump or an eviction; the repo sits near the 10 GB cap). Jobs on trusted triggers such as
workflow_dispatchon main get a write-mode cache token by default, and the lane workflows dispatched that way run PR-head code with a model holding Bash (#8294). Whether that Bash can reach a cache-write path is unproven: the runtime token is set only for node and container action steps, andCLAUDE_CODE_SUBPROCESS_ENV_SCRUBisolates the PID namespace. Tampering with files a later node step in the same job executes has not been probed. - Impact: code runs in
lint-repoon every PR, merge group and scheduled run. That job holdscontents: read,checks: readand no secrets, so it cannot steal credentials. It can forge the markdownlint, typos, zizmor and actionlint results that feedci-status. - Contrast: the shfmt cache checks its binary with
sha256sum -cbefore use.
Fix
Delete the "Restore the markdownlint download" and "Save the markdownlint download" steps so npx fetches from the registry each run. Keying on a lockfile hash would not help, because npx ignores lockfiles. Writer-side hardening (cache-mode: read on the jobs that call the lanes) stays in #8294.
Priority
Low: no secret exposure, and it needs a write-capable main-scope run executing untrusted code first.
- 主要语言
- Shell
- 星标
- 22
- 派生
- 2
- 平均合并
- 3 小时 42 分钟
- 30 天内合并 PR
- 938
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
melodic-software/claude-code-plugins 的其他 Issue
-
admission-deferred priority: medium status: ready work-class: scoped
难度 2/5 1-3 小时 新手友好度 85/100
melodic-software/claude-code-plugins#9914 · 1 条评论 ·
维护者通常 1 天内回复
-
priority: low status: ready work-class: mechanical
难度 1/5 1 小时以内 新手友好度 88/100
melodic-software/claude-code-plugins#9911 · 2 条评论 ·
维护者通常 1 天内回复
-
priority: medium status: ready work-class: scoped
难度 2/5 1-3 小时 新手友好度 78/100
melodic-software/claude-code-plugins#9901 · 2 条评论 ·
维护者通常 1 天内回复
-
admission-deferred needs-human needs-triage status: needs-decision
难度 2/5 1-2 天 新手友好度 78/100
melodic-software/claude-code-plugins#9865 · 1 条评论 ·
维护者通常 1 天内回复
-
priority: medium status: needs-decision work-class: scoped
难度 2/5 1-3 小时 新手友好度 68/100
melodic-software/claude-code-plugins#9855 · 2 条评论 ·
维护者通常 1 天内回复
查看 melodic-software/claude-code-plugins 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
automated issue report
难度 1/5 1 小时以内 新手友好度 85/100
a2aproject/A2A#2387 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
curriculum documentation quality
难度 2/5 1-3 小时 新手友好度 85/100
githubnext/gh-aw-workshop#4965 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
ajeetdsouza/zoxide#1350 ·
维护者通常 2 天内回复