ci(deps): pin brace-expansion to 5.0.9 for GHSA-rgw5-rvv9-x895 (#4945) - #4961
Merged
Merged
Conversation
The previous override (`brace-expansion@>=5.0.0 <5.0.8: ^5.0.8`, added for GHSA-mh99-v99m-4gvg) landed on 5.0.8 — the version GHSA-rgw5-rvv9-x895 (7.5 high) affects. The OSV-Scanner step in validate-deps.yml therefore failed on `main` itself, attaching a red required check to every PR that touched a manifest or the lockfile regardless of its contents (observed on #4944). Move the override bound to `<5.0.9` / `^5.0.9`. Transitive-only via minimatch, so no published manifest changes; 5.0.8 leaves the lockfile entirely. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018iARDqtrhQgz6fVHDeDkbQ
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
xuyushun441-sys
marked this pull request as ready for review
August 3, 2026 18:08
This was referenced Aug 4, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4945
问题
Validate Package Dependencies的 OSV-Scanner step 直接扫pnpm-lock.yaml,命中任一 advisory 就 exit 1。main上它本身就是红的,于是每个触发该 workflow(改动任意package.json/pnpm-lock.yaml/ 相关 script)的 PR 都白白背一条红 —— 在 #4944 上实测复现,而那个 PR 根本没碰 lockfile。Advisory:GHSA-rgw5-rvv9-x895(CVSS 7.5,high),影响
brace-expansion5.0.8,修复版本 5.0.9。讽刺之处在于 5.0.8 正是上一条 advisory(
GHSA-mh99-v99m-4gvg)的 pin 停靠的位置:pnpm-workspace.yaml里原有那条 override 的区间上界恰好就是 5.0.8(开区间),把新受影响的版本排除在 override 之外,所以 5.0.8 岿然不动地留在 lockfile 里。传递路径
纯传递依赖,没有任何 workspace 包直接声明它,全部经
minimatch进来。pnpm why brace-expansion --recursive(修复前)节选:改法
改动就是
pnpm-workspace.yaml里既有那一条 brace-expansion override 的一行:区间上界与 value 一起从 5.0.8 抬到 5.0.9(下界 5.0.0 与写法风格都不变)。精确文本见 Files changed —— 这里不重贴,因为 GitHub 的 body sanitizer 会把引号和尖括号转义成 HTML 实体,放进代码块反而显示成乱码。pnpm v10 只从
pnpm-workspace.yaml读overrides,package.json的pnpm.overrides会被静默忽略(该文件顶部注释已写明),所以 没有新增 override 条目,也没有动根package.json—— 只是把既有条目的边界移动到新 advisory 之后。pnpm install重新解析后,lockfile 的改动面就是这一个包:5.0.8 在packages/snapshots两处的条目整体消失,minimatch@10.2.3与minimatch@10.2.5改指 5.0.9。其余依赖一行未动。由于是传递依赖,没有 published manifest 需要同步,
check-override-consistency.mjs无新增负担(仍然只有 1 条 published-manifest 声明需要核对,绿)。验证(双向)
本地用 workflow 钉住的同一个 scanner 版本(
google/osv-scanner-actionv2.3.8 →osv-scanner_linux_amd64v2.3.8)跑同一条命令。因本容器 egress 策略拦截api.osv.dev(403),改用--offline --download-offline-databases走离线库,数据源等价、结论一致。修复前(红,exit 1) —— 与 issue 里贴的 CI 输出逐字一致:
修复后(绿,exit 0):
该 job 的其余 step 也照原样跑过:
功能抽查(
brace-expansion是minimatch/glob系的传递依赖,挑两个重度依赖 glob 匹配的 check):附带记录
issue 的建议 2(「advisory 无可用修复版本时
validate-deps.yml该怎么表达」)本 PR 不处理 —— 这条 advisory 有修复版本,属于另一个议题(现有机制是osv-scanner.toml的[[IgnoredVulns]],workflow 注释里已指明)。留给维护者决定是否单开。已附 changeset(空 frontmatter,不发版)。