Repository navigation
fix(deps): drop braces from the dependency tree - #41
Merged
Merged
Conversation
GHSA-vfj7-8cjw-p6xm (stack-exhaustion DoS) affects every braces release and has no patched version, so it can only be resolved by removing the packages that pull braces in. Both paths are development tooling: - @babel/cli is not invoked by any script; the build uses babel-loader with @babel/core. Removing it drops chokidar@3 and its braces dependency. - @vscode/vsce 4.0.0 replaces the secretlint CLI and globby/fast-glob with @secretlint/core and tinyglobby, which drops micromatch and braces. It also replaces the native keytar module with prebuilt @napi-rs/keyring. The vsce 3 tree hoisted buffer@5.7.1 (via keytar) and supports-color@7.2.0 (via chalk), which the bundles resolved without declaring: buffer is the Buffer polyfill for @stoplight/yaml-ast-parser in the server browser bundle, and supports-color is debug's optional colour probe in the Node bundles. Declare both, at the versions already bundled, in the workspaces that bundle them, so the built client and server output is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
dependency-auditfails onmain(run 37305388361) even though the same commit passed in #40. A new advisory reached the audit feed between the two runs: GHSA-vfj7-8cjw-p6xm (CVE-2026-93687, high), a stack-exhaustion denial of service inbraces. It affects every release up to 3.0.3, the latest, and has no patched version. The only way to resolve it is to remove the packages that pullbracesin.There are two such paths, both development tooling;
bracesis not in any shipped bundle. The first is@babel/cli→chokidar@3→braces. No script invokes@babel/cli, because the build usesbabel-loaderwith@babel/coreandbabel.config.cjs, so this PR removes it. The second is@vscode/vsce@3→secretlint→globby→fast-glob→micromatch→braces.@vscode/vsce4.0.0 replaces the secretlint CLI andglobwith@secretlint/coreandtinyglobby, so this PR moves to it. That removes 160 lockfile entries and adds 17, none of them production entries. Most of the additions are the prebuilt@napi-rs/keyringbinaries that replace the nativekeytarmodule. The suggestednpm audit fix --forceis not usable here: it installs@babel/cli8, which requires@babel/core8 and Node ≥ 24.11 (.nvmrcpins 24.10.0), and it would not touch the vsce path.Moving to vsce 4 exposed two packages that our bundles used without declaring, because the vsce 3 tree happened to hoist them.
buffer@5.7.1(viakeytar) is theBufferpolyfill for@stoplight/yaml-ast-parserin the server's browser bundle, and without it that build fails.supports-color@7.2.0(viachalk) isdebug's optional colour probe in the client and server Node bundles, and without it the build passes with a warning. This PR declares both, at the versions already being bundled, in the workspaces that bundle them:bufferandsupports-colorin the server'sdevDependencies, andsupports-colorin the client'sdependencies. As a result, the built output does not change.Verification
I ran the build job's steps locally on Node 24.10.0 / npm 11.6.1 after a clean
npm cifrom the updated lockfile.npm audit --audit-level=lowreports 0 vulnerabilities, andnpm ls bracesfinds nothing. All of these passed: the lockfile consistency check,check-version-sync,build:types,lint,typescript:check-types,test:tooling,build:prod(all six webpack compilations clean, with no warnings),check-attribution,test:browser,test:previews,npm run test(server unit tests and e2e, 0 failures),npm publish --dry-run --workspace=serverandvscode:package.To confirm the shipped artifacts are unaffected, I built and packaged
mainand this branch and compared every output file by sha256. All 111 files underclient/distand all 27 underserver/distare byte-identical. Inside the VSIX, the only file that differs isextension/package.json, by exactly the twodevDependenciesedits in this PR.The packaging step in CI is meant to exercise vsce's secretlint scan, so I also checked that vsce 4 still enforces it. With a fake RSA private key planted in a packaged file,
npm run vscode:packagereportedfound private key ... [privatekey], exited 1 and produced no VSIX. After the file was removed, packaging succeeded.This repo uses vsce only for packaging. Its credential-storage change from
keytarto@napi-rs/keyringonly affectsvsce loginandvsce publish, which nothing here invokes.