fix(deps): patch js-yaml and nanoid advisories via pnpm overrides - #1635
Conversation
Resolve all three open Dependabot alerts (all high severity): - GHSA-5p4m-2wfm-xmqj — js-yaml quadratic-CPU !!omap DoS (#96, #97). Root tree carried js-yaml 3.15.0 (via read-yaml-file) and 4.3.0 (via @changesets/parse). Dev-only; never in the published CLI, which uses `yaml`, not `js-yaml`. Pinned to >=3.15.1 / >=4.3.1. - GHSA-2v37-7h3g-55p8 / CVE-2026-67213 — nanoid size=0 infinite loop (#99). Present in both root (dev, via postcss<-vitest) and website (build-time, via postcss<-next) trees. Pinned to >=3.3.17 (resolves to 3.3.18). Overrides added to all four override surfaces (pnpm-workspace.yaml + package.json, root and website) to keep them in sync, each YAML entry annotated with its advisory id and removal condition. flake.nix pnpmDeps FOD hash regenerated for the root lockfile change (verified via nix build; hash-mismatch-count 0). dependabot.yml gains a note documenting the two surfaces Dependabot cannot manage (pnpm overrides + the Nix flake). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change adds pnpm overrides for vulnerable ChangesDependency override maintenance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying openspec-docs with
|
| Latest commit: |
3de740d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d47d9bb1.openspec-docs.pages.dev |
| Branch Preview URL: | https://claude-dependabot-vulnerabil.openspec-docs.pages.dev |
…nerabilities-audit-f0f85f # Conflicts: # flake.nix
alfred-openspec
left a comment
There was a problem hiding this comment.
Both lockfiles resolve only the patched js-yaml 3.15.1/4.3.1 and nanoid 3.3.18 paths, frozen installs and root/website builds pass, pnpm audit reports no known vulnerabilities, the Nix hash validates, and all hosted checks are green. Approved.
Status
Ready. Closes all 3 open Dependabot alerts (all high severity). Build green, full suite passes with zero new failures (3950 passing), flake hash regenerated and verified.
What was wrong
Three high-severity advisories sat open in the dependency tree:
>=4.0.0 <4.3.1@changesets/parse>=3.0.0 <3.15.1read-yaml-file← changesets<3.3.17postcss!!omap): reachable only through the@changesetstoolchain, which parses in-repo changeset files. The published CLI usesyaml, notjs-yaml— js-yaml is never bundled.size: 0): pulled transitively bypostcssin both the root (dev, via vitest→vite) and website (build-time, via Next.js) trees. postcss only ever calls the defaultnanoid(6)— never the vulnerablecustomAlphabet/customRandomwith size 0 — so the flaw is not actually reachable here. The root also carriednanoid@3.3.16un-alerted; fixed too.Real-world exposure for this repo is low (dev/build tooling, no untrusted input), but the alerts are worth clearing for a clean posture and defense-in-depth.
How it was fixed
pnpm
overridespinning each package to a patched floor, added to all four override surfaces (root + website, each inpnpm-workspace.yamlandpackage.json) to match the repo's existing sync convention:Range values (not exact pins) match the existing
brace-expansion/postcssstyle and let future patch releases float in. Each YAML entry is annotated with its advisory id and the removal condition (pnpm why …).Resolved versions after
pnpm install: js-yaml 3.15.1 / 4.3.1, nanoid 3.3.18 — zero residual vulnerable versions in either lockfile.Proof it works
js-yaml@3.15.0,js-yaml@4.3.0, ornanoid@3.3.16remaining;pnpm auditdrops from 3 highs to 0.npm run buildsucceeds;vitest run→ 3950 passed. The only 2 failing files (artifact-workflow,config-profile) fail identically on cleanmain(verified by stashing this change and re-running) — pre-existing and unrelated to dependency changes.lockfileVersion 9.0, minimal diffs (version bumps only), self-consistent under--frozen-lockfile.pnpmDepsFOD hash; regenerated tosha256-4XXIcsL8vkAdjeDAXEl1dn+abxeNWfF9A2ZcmDZZHf0=and verified vianix build(hash-mismatch-count 0). CI'snix-flake-validategate will re-confirm.Notes / nits
dependabot.ymlgains a header comment documenting the two surfaces Dependabot can't manage (pnpm overrides + the Nix flake) — the mechanism this PR relies on.pnpm audit+ the OSV.dev batch API — no vulnerabilities exist beyond these three. The GitHub Actions workflows are already well-hardened (every action SHA-pinned, least-privilegepermissions:, no injection vectors, nopull_request_target); no changes needed. One optional follow-up noted by review:magic-nix-cache-actionis upstream-deprecated (maintenance, not security).🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
js-yaml,nanoid, andfast-uri.Chores