chore: harden supply chain — patch transitive CVEs, enforce frozen lockfile#46
Conversation
…ckfile Adds pnpm.overrides to force patched versions of vulnerable transitive devDependencies (protobufjs, vite, lodash, flatted, picomatch, yaml, postcss — all reachable only via testcontainers/vitest/eslint chains, no production exposure). Adds onlyBuiltDependencies allowlist so only cpu-features, ssh2, and protobufjs may run install scripts — every other transitive postinstall hook is inert by default. Equivalent to the npm ignore-scripts=true pattern but compatible with pnpm's native build flow. CI: pnpm install --frozen-lockfile everywhere (was silent on drift) and a second audit step covering all deps (not just --prod) so future dev CVEs don't sit unsurfaced. Verified: pnpm audit clean (0/0/0/0/0), build/lint/type-check/test green, cpu-features and ssh2 native binaries still produced.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR hardens dependency management and security scanning by introducing dependency override constraints, enforcing frozen-lockfile installation across all CI jobs, and expanding npm audit coverage in the security job to detect both production and development dependency vulnerabilities at a high severity threshold. ChangesDependency Management and Security Hardening
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Summary
Resolves the 21 open Dependabot advisories on
main(1 critical, 10 high, 10 moderate) — all in transitive devDependencies — viapnpm.overrides, plus tightens install/audit discipline in CI.pnpm.overrides: pinprotobufjs >=7.5.8,vite >=8.0.5,lodash >=4.18.0,flatted >=3.4.2,picomatch >=4.0.4,yaml >=2.8.3,postcss >=8.5.14. All reachable only viatestcontainers/vitest/eslintchains — no production exposure.pnpm.onlyBuiltDependencies: explicit allowlist (cpu-features,ssh2,protobufjs). Every other transitivepostinstallhook becomes inert by default. Equivalent toignore-scripts=truebut compatible with pnpm's native build flow (verified: native.nodebinaries still produced for both allowlisted packages).pnpm install --frozen-lockfileon all 7 install steps inci.yml— fails closed on lockfile drift.pnpm audit --prod --audit-level=highis preserved, plus a newpnpm audit --audit-level=highcovering all deps. The--prodfilter silently passes today since every vulnerable package is a devDep — surfacing them in CI prevents future dev-only CVEs from sitting unsurfaced.Verification
pnpm audit→{critical: 0, high: 0, moderate: 0, low: 0, info: 0}(was 1/10/10/0/0)pnpm build→ 2/2 packages succeedpnpm test→ 456 passed, 1 skippedpnpm lint,pnpm type-check→ cleancpu-featuresandssh2native.nodebinaries produced (allowlist works as intended)Context: this was identified by a full supply-chain review against the late-2024 → mid-2026 npm compromise wave (Shai-Hulud I/II/III, Qix-cluster, axios/plain-crypto-js, TanStack CVE-2026-45321, SANDWORM_MODE). No malicious-package matches or active IOCs were found — this PR is the CVE-cleanup half of that audit.
Test plan
pnpm installreproduces clean lockfile statepnpm auditreports zero vulnerabilitiespnpm buildsucceedspnpm test(unit) passes 456/457pnpm lintcleanpnpm type-checkcleancpu-features,ssh2) still built — allowlist verified--frozen-lockfile+ dual audit gate)Summary by CodeRabbit