Skip to content

fix(security): resolve moderate+ audit advisories (v0.1.1) - #3

Merged
borjalofe merged 3 commits into
mainfrom
fix/security-audit
Nov 24, 2026
Merged

borjalofe merged 3 commits into
mainfrom
fix/security-audit

Conversation

@borjalofe

Copy link
Copy Markdown
Owner

Summary

Resolves every pnpm audit advisory rated moderate or higher (20 total: 4 critical, 6 high, 8 moderate). The single remaining low advisory (esbuild dev-server file read on Windows) is below the requested threshold and left untouched.

Version bumped 0.1.0 → 0.1.1 (semver security patch) and documented in CHANGELOG.md.

Changes

  • zod ^3.24.2 → ^4.6.6 (production dependency). GHSA-mrhx-c7xc-m3w5 (high: memory exhaustion validating oversized constrained collections) is patched only in the 4.x line — no 3.x fix exists. Since pnpm overrides do not protect consumers of the published package, the declared range was bumped, not just overridden.
  • formatZodError now types issue paths as ReadonlyArray<PropertyKey> and stringifies each segment, matching zod 4's ZodIssue.path (PropertyKey[]). Public GitCommitConfig API unchanged.
  • Transitive dev deps fixed with pnpm audit --fix (override), recorded in pnpm-workspace.yaml: handlebars ^4.7.10 (JS injection, critical/moderate), tinypool ^2.1.1/2 (prototype pollution → RCE, critical), vitest/@vitest/mocker ^4.1.11/12 (code injection, path traversal, moderate), vite ^7.3.7 (fs.allow bypass, moderate), postcss ^8.5.18/23 (path traversal, high/moderate), source-map-js ^1.2.2 (DoS, high), nanoid ^3.3.16/18 (infinite loop, high).
  • Approved build scripts (@biomejs/biome, esbuild, lefthook) via allowBuilds in pnpm-workspace.yaml so pnpm install and the lefthook pre-commit hook pass.

Verification

  • pnpm audit --audit-level moderate → 0 advisories moderate+ (was 20); 1 low remains.
  • pnpm test → 21 passed (2 files), with vitest 4 + zod 4.
  • pnpm build (tsup + DTS) → success.
  • pnpm biome check on changed files → clean.

Resolve every pnpm audit advisory rated moderate or higher (20 total:
4 critical, 6 high, 8 moderate); the single remaining low (esbuild) is
below the fixed threshold.

- bump zod ^3.24.2 -> ^4.6.6 (production dep): GHSA-mrhx-c7xc-m3w5
  (memory exhaustion) is patched only in the 4.x line, and pnpm overrides
  do not protect published-package consumers, so the declared range is
  bumped rather than only overridden
- adapt formatZodError to zod 4 ZodIssue.path (ReadonlyArray<PropertyKey>),
  keeping the DTS build and tests green; public API unchanged
- apply pnpm audit --fix (override) for transitive dev deps: handlebars,
  tinypool, vitest/@vitest/mocker, vite, postcss, source-map-js, nanoid,
  recorded in pnpm-workspace.yaml
- approve build scripts (@biomejs/biome, esbuild, lefthook) via allowBuilds
  so pnpm install and the lefthook pre-commit hook pass
- bump version to 0.1.1 and document the fixes in CHANGELOG
The security fix added a config-only pnpm-workspace.yaml (overrides,
allowBuilds, minimumReleaseAgeExclude), which is a pnpm 10.4+/11 feature.
pnpm 9 treats any pnpm-workspace.yaml as a workspace and requires a
`packages:` field, so `pnpm store path` (run by actions/setup-node cache)
failed with "packages field missing or empty".

Align CI with the local toolchain (pnpm 11.18, lockfileVersion 9.0 which
is compatible) by bumping pnpm/action-setup from 9 to 11 in every workflow
that installs dependencies.
pnpm 11 (11.29+) requires Node.js >= 22.13; the workflows ran Node 20, so
`pnpm store path` crashed with ERR_UNKNOWN_BUILTIN_MODULE (node:sqlite).
Bump actions/setup-node to Node 22 in every workflow, matching the local
toolchain. The package's runtime support (engines.node >=20) is unchanged,
since the Node 22 requirement is only for the pnpm dev toolchain.
@borjalofe

Copy link
Copy Markdown
Owner Author

Aprobada

@borjalofe
borjalofe merged commit aee7eab into main Nov 24, 2026
2 of 3 checks passed
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.

1 participant