From 2fa51a3c4de3353195ff9f3bf37965365314110b Mon Sep 17 00:00:00 2001 From: Peter van der Veeken Date: Wed, 2 Dec 2026 11:17:08 +0100 Subject: [PATCH] fix(deps): upgrade tar to 8.0.2 tar 7 is affected by a series of advisories published on 1 and 2 December 2026 that are only fixed in tar 8, the last of them in 8.0.2. tar 8 no longer exposes Node.js streams, so extract() can't be the last stream of the download pipeline. Pass the pipeline's output to it through the input option instead. Fixes: https://github.com/nodejs/node-gyp/issues/3395 --- lib/install.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/install.js b/lib/install.js index 3580cdd003..e71c75e368 100644 --- a/lib/install.js +++ b/lib/install.js @@ -231,7 +231,8 @@ async function install (gyp, argv) { contentShasums[filename] = checksum log.verbose('content checksum', filename, checksum) }), - tar.extract({ + (source) => tar.extract({ + input: source, strip: 1, cwd: tarExtractDir, filter: isValid, diff --git a/package.json b/package.json index a8253ce3cc..e6383a2ba6 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "nopt": "^10.0.0", "proc-log": "^7.0.0", "semver": "^7.3.5", - "tar": "^7.5.7", + "tar": "^8.0.2", "tinyglobby": "^0.2.12", "undici": "^8.4.1", "which": "^7.0.0"