Skip to content

fix: patch pnpm audit advisories via dependency floors and overrides - #430

Merged
gitfromwildan merged 1 commit into
mainfrom
fix/deps-audit-pins
Oct 26, 2026
Merged

gitfromwildan merged 1 commit into
mainfrom
fix/deps-audit-pins

Conversation

@gitfromwildan

@gitfromwildan gitfromwildan commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

pnpm audit reported 26 advisories (1 critical, 7 high, 13 moderate, 5 low) across direct, dev and transitive dependencies. After this PR, pnpm audit reports no known vulnerabilities. Each package resolves to the newest patched release of the line already in use. The two exceptions are explained below.

The fix works differently depending on where the package sits:

  • Direct dependencies: a raised floor in package.json. Workspace overrides are not published, so this is the only way the released @docubook/flame and @docubook/core ranges stop accepting the vulnerable versions.
  • Transitive dependencies: an exact pin in pnpm-workspace.yaml overrides.

Direct dependencies: raised floors in package.json

Package Range Where Advisories
zod ^4.6.5 → ^4.6.7 dependencies of core, flame 1 high
vite ^8.3.2 → ^8.3.5 dependencies of flame; dev dep of core, markdown, themes-colors, ui-react 1 high, 4 moderate, 1 low
vitest ^4.1.8 → ^4.1.12 root dev dep 2 moderate (@vitest/mocker, which follows vitest exactly)
@vitest/coverage-v8 ^4.1.11 → ^4.1.12 themes-colors dev dep (kept in step with vitest)

The changeset .changeset/deps-audit-floors.md is a patch for @docubook/core and @docubook/flame, the two packages whose published runtime ranges change. The other packages only change devDependencies.

These were exact overrides in this PR's first version. Pullfrog's review pointed out that overrides never reach npm consumers, and that a global exact pin would silently block later package.json bumps. Its fix is folded into the single commit.

Transitive dependencies: overrides in pnpm-workspace.yaml

Override Before → After Advisories Pulled in by
dompurify 3.4.16 → 3.4.17 1 critical, 1 high, 1 low mermaid (markdown)
fast-uri 4.1.3 → 4.2.3 2 high, 4 moderate, 2 low ajv via @commitlint/cli
js-yaml@4 4.3.1 → 4.3.2 1 high read-yaml-file via @changesets/cli
undici@7 7.30.0 → 7.30.1 1 high, 2 moderate jsdom (vitest, markdown)
mermaid>katex 0.16.47 → 0.18.10 1 low mermaid (markdown)
@tailwindcss/typography>postcss-selector-parser 6.0.10 → 7.1.7 1 moderate @tailwindcss/typography (flame)
  • js-yaml@4 and undici@7 are range-scoped, so the installed js-yaml 5.4.2 is left alone.
  • The existing undici, fast-uri and dompurify entries are replaced by exact versions.

The two cross-line pins

Neither fix exists on the line the parent package asks for, so each override is scoped to that one consumer.

mermaid>katex 0.18.10. mermaid 11.17.2, the latest 11.x, asks for katex ^0.16.47, and the fix starts at 0.18.2. 0.18.11 is deprecated upstream ("accidentally published with breaking changes"), so the pin is 0.18.10, the line mermaid 12 itself targets.

  • Mermaid passes output: "mathml" unless legacyMathML or forceLegacyMathML is set, and DocuBook sets neither.
  • renderToString with mermaid's exact options gives identical MathML across 0.16.47 and 0.18.10 for 12 sample formulas. Invalid input still throws ParseError.
  • The only difference is in htmlAndMathml output, where 0.18 renames classes (base → katex-base and so on). DocuBook never uses that path and ships no KaTeX CSS.

@tailwindcss/typography>postcss-selector-parser 7.1.7. Typography pins 6.0.10 exactly, and no 6.x release has the fix. The flame docs CSS was rebuilt from scratch (asset cache cleared) with typography resolving 7.1.7. The output is byte-identical to the 6.0.10 build: docs.css is 148,503 bytes with 134 .prose selectors, and site.css matches too.

Lockfile

pnpm install rewrites pnpm-lock.yaml with single quotes, so it is Prettier-formatted back to the committed double-quote style, leaving only real changes. vite 8.3.5 also brings rolldown 1.2.15, and katex 0.18 brings commander@15.

Verification

All of the following ran on the final commit:

  • pnpm install --frozen-lockfile passes.
  • pnpm audit: no known vulnerabilities (was 26).
  • Resolved versions match the table above: vite 8.3.5, zod 4.6.7, vitest, @vitest/mocker and @vitest/coverage-v8 4.1.12, plus the six overrides.
  • turbo lint build --force: all tasks pass, uncached.
  • turbo test --force: 1,124 tests pass. flame 676, markdown 122, core 121, themes-colors 120, ui-react 85.
  • pnpm test:release-plan: 6 scenarios pass.
  • scripts/flame-browser-smoke.mjs (headless Chromium): /, /docs/, accordion and tabs pages load, hydrate and respond to input.
  • Pre-push hook (lint, build, commitlint) passes.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Preview Oct 26, 2026 3:44pm UTC

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues. One gap is worth closing: the vite and zod fixes don't reach published packages.

Reviewed changes

I reviewed the full override and lockfile diff, which pins patched versions for every open pnpm audit advisory.

  • Replaced range overrides with exact pins: undici@7 → 7.30.1, fast-uri → 4.2.3, dompurify → 3.4.17.
  • New pins: js-yaml@4, vite, vitest/@vitest/mocker/@vitest/coverage-v8 and zod are now pinned to exact versions in the workspace.
  • Pins scoped to one consumer that cross a major line: mermaid>katex 0.18.10 and @tailwindcss/typography>postcss-selector-parser 7.1.7 are each scoped to their single consumer. The PR description backs them with MathML and CSS output comparisons.
  • Lockfile churn: the version bumps pull in rolldown 1.2.15 and commander@15 (through katex). The @oxc-parser/binding-* snapshots also lost their optional: true flag. I ran pnpm install --lockfile-only with the pinned pnpm 12.3.4, and it produces the same entries, so this is pnpm's normal output and not a hand edit.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread pnpm-workspace.yaml Resolved
@gitfromwildan gitfromwildan self-assigned this Oct 26, 2026
@gitfromwildan gitfromwildan added the dependencies Pull requests that update a dependency file label Oct 26, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Pullfrog addressed all of its review feedback on this PR.

Addressed the one thread from review #5654682882 in 27bbad5.

  • Fixed (pnpm-workspace.yaml:17-21): I removed the exact overrides on vite, zod, vitest, @vitest/mocker and @vitest/coverage-v8. The package.json version ranges now start at the patched versions instead: vite ^8.3.5 (core, flame, markdown, themes-colors, ui-react), zod ^4.6.7 (core, flame), vitest ^4.1.12 (root) and @vitest/coverage-v8 ^4.1.12 (themes-colors). @vitest/mocker follows vitest, so it still resolves to 4.1.12 without an override. The published @docubook/core and @docubook/flame ranges no longer accept the vulnerable versions.
  • Changeset: I added .changeset/deps-audit-floors.md, a patch for @docubook/core and @docubook/flame.
  • Lockfile: I regenerated it and formatted it with Prettier. The only changes are the version ranges and the removed override block. pnpm also put back the optional: true flags on the @oxc-parser/binding-* entries.

Checks: pnpm install --frozen-lockfile passes and pnpm audit reports no known vulnerabilities. pnpm lint is clean. Tests pass for core (121) and themes-colors (120), and pnpm test:release-plan passes. I did not rerun the full turbo test suite. The pre-push hook passed.

The PR description is now out of date: it still lists the five removed pins and says "No changeset". It needs updating before merge.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

pnpm audit reported 26 advisories (1 critical, 7 high, 13 moderate,
5 low) across direct, dev and transitive dependencies. Each now
resolves to the newest patched release of the line already in use.

Direct dependencies get raised floors in package.json, not overrides.
Workspace overrides are not published, so the released ranges of
@docubook/flame (vite, zod) and @docubook/core (zod) would otherwise
still accept the vulnerable versions. A global exact pin would also
silently hold back later bumps.

- zod ^4.6.7 (core, flame; changeset patch for both)
- vite ^8.3.5 (flame dependency; dev dependency elsewhere)
- vitest ^4.1.12 (root), @vitest/coverage-v8 ^4.1.12 (themes-colors);
  @vitest/mocker follows vitest exactly

Transitive dependencies are pinned in pnpm-workspace.yaml overrides:

- dompurify 3.4.17 (mermaid; critical SAFE_FOR_TEMPLATES bypass)
- fast-uri 4.2.3 (ajv via commitlint; 8 advisories)
- js-yaml@4 4.3.2 (read-yaml-file via changesets; js-yaml 5 untouched)
- undici@7 7.30.1 (jsdom)

Two fixes exist only on a newer line, so their overrides are scoped to
the one consumer:

- mermaid>katex 0.18.10: mermaid 11.17.2 (latest 11.x) asks for
  ^0.16.47. 0.18.10 is the last non-deprecated 0.18 (0.18.11 was
  published with breaking changes). Mermaid renders with
  output "mathml" unless legacyMathML/forceLegacyMathML is set, which
  DocuBook never does, and that output is identical across 0.16.47
  and 0.18.10. Only the htmlAndMathml class names changed.
- @tailwindcss/typography>postcss-selector-parser 7.1.7: typography
  pins 6.0.10 exactly and 6.x has no fix. The flame docs CSS rebuilt
  with 7.1.7 is byte-identical to the 6.0.10 output.

pnpm-lock.yaml is regenerated and Prettier-formatted to match the
committed style. pnpm audit now reports no known vulnerabilities.

Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gitfromwildan gitfromwildan changed the title fix: pin patched versions for pnpm audit advisories fix: patch pnpm audit advisories via dependency floors and overrides Oct 26, 2026
@gitfromwildan
gitfromwildan merged commit 0956fdf into main Oct 26, 2026
16 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 26, 2026
@gitfromwildan
gitfromwildan deleted the fix/deps-audit-pins branch October 26, 2026 15:57
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant