Skip to content

ci(deps): pin brace-expansion to 5.0.9 for GHSA-rgw5-rvv9-x895 (#4945) - #4961

Merged
xuyushun441-sys merged 1 commit into
mainfrom
claude/issue-4945-brace-expansion-advisory
Aug 3, 2026
Merged

ci(deps): pin brace-expansion to 5.0.9 for GHSA-rgw5-rvv9-x895 (#4945)#4961
xuyushun441-sys merged 1 commit into
mainfrom
claude/issue-4945-brace-expansion-advisory

Conversation

@xuyushun441-sys

@xuyushun441-sys xuyushun441-sys commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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-expansion 5.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(修复前)节选:

brace-expansion@5.0.8
├─┬ minimatch@10.2.3
│ ├─┬ @ts-morph/common@0.29.0
│ │ └─┬ ts-morph@28.0.0
│ │   └── @objectstack/cli@17.0.0-rc.2 (dependencies)
│ ├─┬ @typescript-eslint/typescript-estree@8.65.0
│ │ └─┬ @typescript-eslint/parser@8.65.0
│ │   └── @objectstack/spec-monorepo@4.0.1 (devDependencies)
│ ├─┬ @vscode/vsce@3.9.2
│ │ └── objectstack-vscode@17.0.0-rc.2 (devDependencies)
│ ├─┬ glob@13.0.6
│ │ ├── @objectstack/metadata@17.0.0-rc.2 (dependencies)
│ │ └── @vscode/vsce@3.9.2 [deduped]
│ ├─┬ glob@7.2.3
│ │ └─┬ archiver-utils@2.1.0 → archiver@5.3.2 → exceljs@4.4.0
│ │     └── @objectstack/rest@17.0.0-rc.2 (dependencies)
│ └─┬ readdir-glob@1.1.3 → archiver@5.3.2 [deduped]
└─┬ minimatch@10.2.5
  └─┬ eslint@10.8.0
    └── @objectstack/spec-monorepo@4.0.1 (devDependencies)

brace-expansion@5.0.9
└─┬ minimatch@10.2.6   (@eslint/config-array, @oclif/core — 已经在修好的版本上)

改法

改动就是 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.yamloverrides,package.jsonpnpm.overrides 会被静默忽略(该文件顶部注释已写明),所以 没有新增 override 条目,也没有动根 package.json —— 只是把既有条目的边界移动到新 advisory 之后。

pnpm install 重新解析后,lockfile 的改动面就是这一个包:5.0.8 在 packages / snapshots 两处的条目整体消失,minimatch@10.2.3minimatch@10.2.5 改指 5.0.9。其余依赖一行未动。

由于是传递依赖,没有 published manifest 需要同步,check-override-consistency.mjs 无新增负担(仍然只有 1 条 published-manifest 声明需要核对,绿)。

验证(双向)

本地用 workflow 钉住的同一个 scanner 版本(google/osv-scanner-action v2.3.8 → osv-scanner_linux_amd64 v2.3.8)跑同一条命令。因本容器 egress 策略拦截 api.osv.dev(403),改用 --offline --download-offline-databases 走离线库,数据源等价、结论一致。

修复前(红,exit 1) —— 与 issue 里贴的 CI 输出逐字一致:

Scanned /home/user/objectstack-4945/pnpm-lock.yaml file and found 1503 packages
Total 1 package affected by 1 known vulnerability (0 Critical, 1 High, 0 Medium, 0 Low, 0 Unknown) from 1 ecosystem.
1 vulnerability can be fixed.

+-------------------------------------+------+-----------+-----------------+---------+---------------+----------------+
| OSV URL                             | CVSS | ECOSYSTEM | PACKAGE         | VERSION | FIXED VERSION | SOURCE         |
+-------------------------------------+------+-----------+-----------------+---------+---------------+----------------+
| https://osv.dev/GHSA-rgw5-rvv9-x895 | 7.5  | npm       | brace-expansion | 5.0.8   | 5.0.9         | pnpm-lock.yaml |
+-------------------------------------+------+-----------+-----------------+---------+---------------+----------------+
EXIT=1

修复后(绿,exit 0):

Scanned /home/user/objectstack-4945/pnpm-lock.yaml file and found 1502 packages
Loaded npm local db from /root/.cache/osv-scanner/npm/all.zip

No issues found
EXIT=0

该 job 的其余 step 也照原样跑过:

$ pnpm install --frozen-lockfile --prefer-offline      → Done in 4.5s  (lockfile 自洽)
$ node scripts/check-changeset-fixed.mjs               → ✓ fixed group in sync with 69 public workspace packages
$ node scripts/check-override-consistency.mjs          → ✓ 1 published-manifest declaration(s) … resolve to their override targets

功能抽查(brace-expansionminimatch/glob 系的传递依赖,挑两个重度依赖 glob 匹配的 check):

$ pnpm check:doc-authoring     → ✓ 219 files clean — no bare metadata literals.
$ pnpm check:published-files   → ✓ 69 publishable package(s) … declare a files whitelist …

附带记录

issue 的建议 2(「advisory 无可用修复版本时 validate-deps.yml 该怎么表达」)本 PR 不处理 —— 这条 advisory 有修复版本,属于另一个议题(现有机制是 osv-scanner.toml[[IgnoredVulns]],workflow 注释里已指明)。留给维护者决定是否单开。

已附 changeset(空 frontmatter,不发版)。

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
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 3, 2026 5:16pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file tooling size/s labels Aug 3, 2026
@xuyushun441-sys
xuyushun441-sys marked this pull request as ready for review August 3, 2026 18:08
@xuyushun441-sys
xuyushun441-sys added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit ec48539 Aug 3, 2026
25 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the claude/issue-4945-brace-expansion-advisory branch August 3, 2026 18:20
lemonhub-io pushed a commit to OpenFork-org/objectstack that referenced this pull request Aug 8, 2026
…#6407) (objectstack-ai#6427)

`Validate Package Dependencies` 的 OSV-Scanner 在 pnpm-lock.yaml 上命中
GHSA-55q2-fjhq-7xh7(5.1 medium):dompurify 的 IN_PLACE hook 移除会留下
一棵仍可执行的 detached subtree(XSS)。公告有 fixed version(3.4.13),
按 osv-scanner.toml 抬头写明的纪律,这类一律「take the fix」,不走豁免。

dompurify 是 mermaid 的传递依赖(apps/docs 声明 mermaid ^11.16.0,
mermaid@11.16.1 声明 dompurify ^3.3.3),没有任何工作区包直接声明它,
所以落点是 pnpm-workspace.yaml 的 override 块 —— 本仓不读 package.json
里的 overrides。

选择器上界放在 4.0.0 这个 major 边界而不是 exclusive 的 fixed version:
写成 `<3.4.13` 会在 3.4.13 自己被公告的那天静默失配(undici 7.28.0 与
brace-expansion 5.0.8 两具活体标本,objectstack-ai#4961 / objectstack-ai#5032)。以后只挪 target。


Claude-Session: https://claude.ai/code/session_01BDmDsu2575gDxeMCxXhDE3

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/s tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI red on every PR: Validate Package Dependencies fails on GHSA-rgw5-rvv9-x895 (brace-expansion 5.0.8 → 5.0.9)

2 participants