Skip to content

fix: replace fast-glob with tinyglobby to drop braces (CVE-2026-93687) @W-24615276@ - #1069

Merged
k80bowman merged 1 commit into
salesforcecli:mainfrom
jontg:fix/replace-fast-glob-with-tinyglobby
Oct 22, 2026
Merged

k80bowman merged 1 commit into
salesforcecli:mainfrom
jontg:fix/replace-fast-glob-with-tinyglobby

Conversation

@jontg

@jontg jontg commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Replaces fast-glob with tinyglobby in src/shared/fs.ts.

fast-glob → micromatch → braces@3.0.3 is flagged by an open CVE, CVE-2026-93687 / GHSA-vfj7-8cjw-p6xm. The CVE is disputed upstream (micromatch/braces#70) and no patched release exists, so we can't wait for a fix. Dropping the dependency clears it for @salesforce/cli. tinyglobby uses fdir + picomatch (no braces) and is already in the sf CLI dependency tree through @oclif/plugin-plugins.

A straight swap would change the output, so a small globPaths helper keeps the existing behavior:

fast-glob tinyglobby (default) globPaths
Absolute pattern absolute paths cwd-relative (../../…) absolute paths
Directory results objects objects/ objects
Multiple patterns pattern-by-pattern interleaved pattern-by-pattern

@types/picomatch is added as a devDependency because fdir's typings import picomatch (same approach as oclif/core).

Testing

  • yarn test (compile, lint, unit tests, command-reference, deprecation policy) passes.
  • test/nuts/fs.nut.ts passes 4/4. It exercises all three changed functions against sample-project-multiple-packages.
  • Ran the old fast-glob implementations and the new functions side by side on a fixture project with relative, ., absolute, cwd-outside-project and multi-package-dir inputs. All outputs, including order, are identical.
  • After this change, yarn why braces shows braces only via dev dependencies (oclif, @salesforce/dev-scripts).

What issues does this PR fix or reference?

  • CVE-2026-93687 / GHSA-vfj7-8cjw-p6xm
  • Part of removing braces from @salesforce/cli runtime deps. The other two paths are @salesforce/apex-node (forcedotcom/salesforcedx-apex) and @salesforce/packaging (forcedotcom/packaging). Follow-up PRs will go to those repos.
  • @W-24615276@

fast-glob pulls in micromatch -> braces@3.0.3, which is flagged by
CVE-2026-93687 / GHSA-vfj7-8cjw-p6xm. No patched braces release exists
and the upstream maintainer disputes the CVE, so the only way to clear
it for consumers (including @salesforce/cli) is to drop the dependency.

tinyglobby (fdir + picomatch) has no braces dependency and is already
in the sf CLI dependency tree via @oclif/plugin-plugins.

The new globPaths helper preserves fast-glob's output contract:
- absolute patterns return absolute paths (tinyglobby returns cwd-relative)
- directories have no trailing slash
- results are ordered pattern-by-pattern (tinyglobby interleaves)

@types/picomatch is added as a devDependency because fdir's typings
import picomatch (same approach as oclif/core).
@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! It looks like @jontg is an internal user so signing the CLA is not required. However, we need to confirm this.

@k80bowman k80bowman 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.

Thank you for taking care of this! I checked the CI tests on a separate branch, they all passed.

@k80bowman
k80bowman merged commit 28d719d into salesforcecli:main Oct 22, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants