fix(deps): drop unused request via node-ninja/nw-gyp aliases (Dependabot 38) - #433
Merged
Merged
Conversation
Dependabot alert 38 is GHSA-p8p7-x288-28g6 (SSRF in request <=2.88.2). request is deprecated with no patched release, so the advisory cannot be resolved by upgrading. npm audit's suggested fix is a semver-major downgrade of prebuild 13 -> 3.0.3, which is not viable. request is not used anywhere in this repo -- it arrives purely as a dev-only transitive dependency: prebuild@13 -> node-ninja@1.0.2 -> request@2.88.2 -> nw-gyp@3.6.8 -> request@2.88.2 Both are alternative gyp backends we never invoke: node-ninja needs --backend node-ninja, and nw-gyp only engages for -r nw (prebuild.js:18). Our workflows only run `prebuild --strip` and `prebuild -r electron`, both of which use the plain node-gyp backend. prebuild/gyp.js:6-8 requires all three backends eagerly at load, so they cannot simply be removed. node-gyp exports the same require(...)() factory shape, so aliasing both to node-gyp keeps gyp.js loading while dropping the request subtree entirely. Verified: all three backends construct with parseArgv/commands intact, `npx prebuild --version` reports 13.0.1, `npm ls request` is empty and `npm audit` reports 0 vulnerabilities (was 4 moderate). Co-Authored-By: Claude Opus 5 (1M context) <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.
Closes Dependabot alert 38 — GHSA-p8p7-x288-28g6, SSRF in
request<=2.88.2(moderate).Why not just upgrade
requestwas deprecated in 2020, 2.88.2 is the final release, and the advisory has no patched version.npm audit's suggested fix is a semver-major downgrade ofprebuild13 → 3.0.3, which is not viable.Where it came from
requestis not referenced anywhere in this repo — not inlib/,test/, orsamples/. It arrives purely as a dev-only transitive dependency:Both are alternative gyp backends we never invoke.
node-ninjarequires--backend node-ninja;nw-gyponly engages for-r nw(prebuild.js:18). Our workflows runnpx prebuild --stripandnpx prebuild -r electron, both of which use the plain node-gyp backend.The fix
They can't simply be dropped —
prebuild/gyp.js:6-8requires all three backends eagerly at module load.node-gypexports the samerequire(...)()factory shape, so aliasing both to it keepsgyp.jsloading while removing therequestsubtree entirely:Net effect on the lockfile: -951 lines.
Verification
npm ls requestrequest@2.88.2×2npm auditnpx prebuild --versionprebuild/gyp.jsloadsparseArgv/commandsThe aliases resolve to
node-gyp@12.4.0undernode_modules/prebuild/node_modules/(not hoisted), which is wheregyp.jsresolves them from.This does not touch the
cd node_modules/prebuild && npm install --no-save node-gyp@^13ABI-refresh step inprebuild.yml— that targets prebuild's own bundlednode-gyp(10.3.1), which is independent of the aliased backends.Testing note
The lockfile was regenerated with
npm install --ignore-scripts, so the native addon was not rebuilt locally. A manualworkflow_dispatchrun of Prebuild Binaries is the meaningful confirmation thatnpx prebuild --stripstill produces artifacts with the aliases in place.🤖 Generated with Claude Code