Skip to content

[PR] fix(security): bump zod 4.1.8 -> 4.6.7 to clear GHSA-mrhx-c7xc-m3w5 (#4820) - #4880

Merged
ranxianglei merged 8 commits into
masterfrom
2026-10-27_zod-bump-4820
Oct 31, 2026
Merged

ranxianglei merged 8 commits into
masterfrom
2026-10-27_zod-bump-4820

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #4820

Bumps the direct zod dependency from 4.1.8 to 4.6.7 (latest patched release; the patched line for GHSA-mrhx-c7xc-m3w5 / CVE-2023-54404 starts at 4.6.6) and records the jimp nested-zod finding.

What changed

  • package.json + package-lock.json: dependencies.zod 4.1.8 -> 4.6.7. The pin stays exact (not a range), preserving the KDD fix: keep system prompt byte-stable for prefix cache #1 single-shared-instance intent. Only the top-level node_modules/zod entry moves; the 16 nested @jimp/*/node_modules/zod copies are untouched (still 3.25.76, pinned by @jimp's own ^3.23.8).
  • AGENTS.md: KDD fix: keep system prompt byte-stable for prefix cache #1 line updated to 4.6.7 with the advisory reason.
  • TECHNICAL-NOTES.md: new section recording the two-chain analysis — the direct-zod fix, and why the jimp nested-zod@3.x audit hit is a source-level false positive (the vulnerable $ZodArray.handleArrayResult exists only in zod's v4 implementation, never in v3; import "zod" in a 3.25.x install resolves to the v3 core; @jimp/* import plain "zod", never zod/v4). We deliberately do not force-override jimp's zod 3->4.
  • tests/opencode-native-v1.test.ts: comment version references 4.1.8 -> 4.6.7 (no logic change).

Verification

  • Targeted interop suite tests/opencode-native-v1.test.ts: 28/28 pass on zod 4.6.7. Build clean (dist-external: OK — zod stays external per 197-master 发版最后 #3511); typecheck clean.
  • Full regression delegated to CI on this head.

Behavior change (disclosed)

  • Dependency version only: zod 4.1.8 -> 4.6.7, same major (4.x). The only consumer in our tree is src/agent/opencode-native.ts (OpenCode V1 plugin tools, lazy opaque import); it is not loaded in the Pi/proxy lanes. No wire/config/persistence change.

Honest limits (per #4820 condition 1)

  • The targeted test exercises bili's pipeline against its own zod 4.6.7. A true cross-instance check against the live OpenCode host's bundled zod needs the gated e2e lane; opencode-ai@1.19.4 is self-contained (no declared zod dep), so its internal zod version isn't visible via registry metadata. If you want that e2e run before merge, say so and I'll trigger it.
  • KDD fix: keep system prompt byte-stable for prefix cache #1 says the exact pin is meant to match the opencode host's own zod; I could not confirm the host's internal version from registry metadata (above). Flagging rather than assuming.

FYI (not fixed here, kept out of this diff)

  • Pre-existing drift on master: committed kernel/package.json is 0.0.165 while package-lock.json records 0.0.163. npm install normalized it; I reverted that hunk to keep this PR scoped to zod. Left as-is on master.

…4820)

- direct zod to the latest patched release (patched line starts at 4.6.6); pin stays exact per KDD #1
- record the jimp nested-zod@3.x audit finding as a source-level false positive (TECHNICAL-NOTES.md)
- update the KDD #1 line and the opencode-native-v1 test comment to the new version
@ranxianglei ranxianglei changed the title fix(security): bump zod 4.1.8 -> 4.6.7 to clear GHSA-mrhx-c7xc-m3w5 (#4820) [PR] fix(security): bump zod 4.1.8 -> 4.6.7 to clear GHSA-mrhx-c7xc-m3w5 (#4820) Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-27_zod-bump-4820 (822bcaf)

Latest build — install this exact version

npm install -g billion-context@0.0.7325-pr.4880.7f9554b

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
822bcaf billion-context@0.0.7325-pr.4880.7f9554b build
27d68f9 billion-context@0.0.7102-pr.4880.ed7b9a9 build
bf2e62c billion-context@0.0.7044-pr.4880.07c1d0a build
14cfab0 billion-context@0.0.6840-pr.4880.6de55e1 build
5cd6298 billion-context@0.0.6620-pr.4880.09cb4d3 build
7f6d2d4 billion-context@0.0.6344-pr.4880.fb890a3 build
507d5eb billion-context@0.0.6326-pr.4880.b12c203 build
fa3da7b billion-context@0.0.6316-pr.4880.8bd339d build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr4880.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Merged origin/master into the branch (no conflicts, lockfile zod still 4.6.7) and pushed as 507d5eb — PR is now up-to-date with master; mergeable_state=blocked only while CI is still running (12 success / 9 skipped / 11 queued, no failures).

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b) Stale re-trigger — no action taken: branch head 507d5eb already contains origin/master (23158db); PR is up-to-date, mergeable_state=blocked only on pending CI (13 success / 12 skipped / 10 queued, no failures).

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Merge-guard summary: round 1 was real — merged origin/master into 2026-10-27_zod-bump-4820 (no conflicts; zod still 4.6.7 in package.json + lockfile), pushed head 507d5eb. Subsequent "behind" re-triggers were stale replays: master tip stayed at 23158db the whole time, the branch provably contains it, and GitHub reports mergeable=true, state=blocked only on pending CI (successes accumulating, zero failures). No further sync/push needed; PR is up-to-date with master and ready to merge once CI goes green.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Merge-guard round 2: master had genuinely moved this time (→ 0cf53c8, #4854/#4817/#4849/#4825/#4866/#4864/#4863 + kernel 0.0.168 lock-sync); merged into 2026-10-27_zod-bump-4820 with no conflicts, zod bump intact (package.json + lockfile still 4.6.7, zero 4.1.8), pushed as 7f6d2d4 — PR now up-to-date, mergeable=True, state=blocked only on pending CI (22 queued / 1 running / 0 failures).

@w-r-b

w-r-b commented Oct 28, 2026

Copy link
Copy Markdown

@ranxianglei Friendly ping on this PR for #4820. The current checks show 37 successful and 14 skipped, with no failures. Could you please review it and merge if ready? If any additional validation (including the live OpenCode cross-instance e2e mentioned in the issue) is required before merging, please clarify what remains. Thanks!

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Status on your ping — confirmed those numbers: head 7f6d2d43b had 37 success / 14 skipped / 0 failures. One catch: master moved past that head again while we were waiting, so I synced once more (clean merge, zod bump verified intact: package.json + lockfile still exact 4.6.7, zero 4.1.8) and pushed new head 5cd62980e — CI is re-running on it now (23 checks queued, state blocked = pending CI only, no failures anywhere).

What remains before merge: nothing mandatory. The only open item is the optional live-OpenCode-host cross-instance e2e that the PR body explicitly defers to the owner ("if you want that e2e run before merge, say so") — everything else is done: targeted interop suite 28/28 on zod 4.6.7, build clean (zod stays external), typecheck clean, full regression green on the prior head. Also noted in the PR body as out-of-scope FYI: pre-existing kernel version drift on master (kernel/package.json 0.0.165 vs lockfile 0.0.163), deliberately left untouched.

On merging itself: I can't merge PRs — that's human-only per repo policy. Once CI goes green on 5cd62980e, please merge here: #4880 (or say the word if you want the cross-instance e2e triggered first).

@ranxianglei
ranxianglei merged commit 9d53c22 into master Oct 31, 2026
47 of 51 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.962-master.9d53c22 (rolling master tag).

npm install -g billion-context@0.0.962-master.9d53c22  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependency security: pinned Zod and optional Jimp retain GHSA-mrhx-c7xc-m3w5 audit warnings

2 participants