Repository navigation
chore(deps): update tmp to 0.2.7 and drop the unused glob dependency - #257
Open
lifeiswilde wants to merge 1 commit into
Open
lifeiswilde wants to merge 1 commit into
lifeiswilde wants to merge 1 commit into
Conversation
tmp 0.2.7 has no dependencies, so the bundle no longer carries tmp -> rimraf 3 -> glob 7 -> minimatch/inflight/once and friends. glob was listed in pyright-scip's dependencies, so npm installed it for every consumer, but nothing in src/, test/ or the webpack config requires it. The build/ scripts that use it resolve it from the root devDependency. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What changes
packages/pyright-internal:tmpgoes from^0.2.1to^0.2.7(package.json and lock).packages/pyright-scip:globis removed fromdependencies(package.json and lock).The lock diffs contain only those changes plus the
"dev": trueflags npm adds to the glob 7 chain, which is now reachable from dev dependencies only.Why
Dependency scanners flag
@sourcegraph/scip-pythonforglob7 (GHSA-c6wh-w8c3-cv3g, glob <= 14.0.5), by two routes:dist/vendor.jsis a webpack bundle that carriestmp0.2.1 ->rimraf3.0.2 ->glob7 (plusminimatch,inflight,onceand others), all pulled in bypyright-internal.tmp0.2.7 has no dependencies, so the whole chain leaves the bundle.packages/pyright-scip/package.jsonlistsglobindependencies, so npm installsglob7.2.3 for every consumer. Nothing undersrc/,test/, the webpack config,index.jsor the package scripts requires it. Thebuild/scripts that useglobresolve it from the rootdevDependencies, so they are unaffected.Reachability
The advisory's path (an absolute
ignorepattern with braces inrootorcwd) is not reachable in scip-python today. The bundledglobwas only called byrimraffor temporary file cleanup, with noignore,rootorcwd. This change is about the scanner flag and about taking a stale dependency chain out of the bundle, not about an exploitable path.tmpadvisoriestmp0.2.1 is also covered by two advisories that 0.2.7 fixes:diroption, affects <= 0.2.3, fixed in 0.2.4.prefix,postfixordir, affects < 0.2.6, fixed in 0.2.6.scip-python only passes fixed values to
tmp, so these were not reachable either.tmpAPI checktmpis used in one file,packages/pyright-internal/src/common/realFileSystem.ts. Its calls were checked against the 0.2.7 source and run against both 0.2.1 and 0.2.7:tmp.setGracefulCleanup(): unchanged.tmp.dirSync({ prefix: 'pyright' }): unchanged.tmp.fileSync({ dir: <that directory>, discardDescriptor: true, ...options }): unchanged.tmp0.2.4 and later requiredirto resolve inside the system temp directory; the directory comes from thedirSynccall above, so it does.removeCallback()on the directory: behaves as before (it throwsENOTEMPTYon a non-empty directory in both versions, anddispose()already ignores that).One observable difference:
tmp0.2.4 and later return the real path of the temp directory, so on macOS the name is/private/var/...where it was/var/....Testing
Node 24.4.1 and Python 3.10.22 (the versions in
.tool-versions), npm 11.4.2:npm installat the root, then inpackages/pyright-scip:npm install && npm run build(production webpack bundle).npm test -- --runInBand: 7 tests passed.npm run check-snapshots: 22/22 tests passed, 0 failed.npm install --package-lock-only --ignore-scriptsinpackages/pyright-scip(the lock check in CI) leaves no diff, andnode build/checkLockIndent.jspasses.dist/vendor.js.maplists noglob,rimraf,minimatch,inflight,onceorwrappysources (the published 0.6.8 map lists all of them); the 16 sources it no longer has are theglob7 chain andrimraf.package.jsonhas noglobdependency. Installing the tarball into an empty folder and runningnpm ls glob --allshows noglob(installing the published 0.6.8 showsglob@7.2.3), andnpm auditthere reports 0 vulnerabilities.🤖 Generated with Claude Code