Skip to content

chore(deps): override argparse 1 in docs to drop vulnerable sprintf-js - #14

Merged
paustint merged 1 commit into
mainfrom
chore/docs-audit-sprintf-js
Oct 16, 2026
Merged

paustint merged 1 commit into
mainfrom
chore/docs-audit-sprintf-js

Conversation

@paustint

Copy link
Copy Markdown
Contributor

Summary

Resolves the open sprintf-js Dependabot alert (#43, GHSA-hp3w-g68c-fv3c, moderate) in docs/. Upstream has no patched release, so the fix is to drop the package entirely.

  • The only path to sprintf-js was docusaurus-plugin-llms → gray-matter@4.0.3 (pinned) → js-yaml@3 → argparse@1 → sprintf-js@1.0.3.
  • js-yaml 3 requires argparse only from its CLI (bin/js-yaml.js). The library that gray-matter loads never touches it.
  • Overriding argparse@^1 → ^2.0.1 dedupes onto the argparse@2.0.1 already in the tree (via js-yaml 4), and sprintf-js drops out.

npm audit in docs/ goes from 33 advisories (29 high, 4 moderate) to 29 high.

What's left: braces (alert #42, high)

All 29 remaining advisories trace to braces <=3.0.3 (GHSA-vfj7-8cjw-p6xm). There is no patched release, and even the latest Docusaurus 4 canary is affected through micromatch, chokidar and fast-glob, so no override can fix it. It is a stack-exhaustion DoS triggered by deeply nested brace patterns. The docs toolchain only expands glob patterns we write ourselves, and none of it ships in the static site.

Testing

  • npm ci && npm run build at the root, then npm ci && npm run build in docs/ (the CI docs job): succeeds. docusaurus-plugin-llms processed all 11 documents through gray-matter.
  • npm ls argparse sprintf-js --all: only argparse@2.0.1, no sprintf-js.
  • npm run format:check and npm run lint pass.

No changelog entry: nothing under src/ changed.

docusaurus-plugin-llms pins gray-matter 4.0.3, which pulls js-yaml 3 ->
argparse 1 -> sprintf-js 1.0.3 (GHSA-hp3w-g68c-fv3c, no patched
release). js-yaml 3 only requires argparse from its CLI (bin/js-yaml.js),
never from the library gray-matter loads, so overriding argparse@^1 to
^2 dedupes onto the argparse 2.0.1 already in the tree and removes
sprintf-js entirely. npm audit: 33 -> 29 advisories.

The remaining 29 all trace to braces <=3.0.3 (GHSA-vfj7-8cjw-p6xm),
which also has no patched release and sits under micromatch, chokidar
and fast-glob throughout Docusaurus.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 13:08
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying simple-excel with  Cloudflare Pages  Cloudflare Pages

Latest commit: dc6d25b
Status:🚫  Build failed.

View logs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The targeted docs-only override and lockfile changes are consistent, with no blocking issues identified.

0 open findings

What changed in this PR

Removes the vulnerable sprintf-js dependency from the documentation toolchain without changing library code.

Changes:

  • Overrides argparse@^1 with ^2.0.1.
  • Removes obsolete argparse and sprintf-js lockfile entries.
File Description
docs/​package.json Adds the targeted argparse override.
docs/​package-lock.json Removes dependencies eliminated by the override.
Files not reviewed (1)
  • docs/package-lock.json: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@paustint
paustint merged commit bd83630 into main Oct 16, 2026
12 of 13 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.

2 participants