Skip to content

Commit 1610280

Browse files
martinrrmCopilot
andauthored
## Summary Updates the bundled `tar` dependency from `7.5.19` to `7.5.22` on the npm 11 release branch. This resolves [GHSA-r292-9mhp-454m](GHSA-r292-9mhp-454m), which affects `tar` versions through `7.5.20`. All production dependency paths now resolve to `[email protected]`. ## Testing - `node . run dependencies --ignore-scripts` - `node . ls tar --all --omit=dev` - `node . audit --omit=dev --json` reports no `tar` vulnerability - `node . test --ignore-scripts` reports the environment-specific `EXDEV` failure in `test/bin/windows-shims.js`; all other tests pass Co-authored-by: Copilot <[email protected]>
1 parent bfacd33 commit 1610280

9 files changed

Lines changed: 50 additions & 14 deletions

File tree

‎node_modules/tar/dist/commonjs/index.min.js‎

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

‎node_modules/tar/dist/commonjs/list.js‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,22 @@ const onReadEntryFunction = (opt) => {
5959
const filesFilter = (opt, files) => {
6060
const map = new Map(files.map(f => [(0, strip_trailing_slashes_js_1.stripTrailingSlashes)(f), true]));
6161
const filter = opt.filter;
62-
const mapHas = (file, r = '') => {
62+
// limit recursion to 100 levels
63+
const MAX = 100;
64+
const mapHas = (file, r = '', depth = 0) => {
65+
/* c8 ignore start - excessive caution */
66+
if (depth >= MAX) {
67+
map.set(file, false);
68+
return false;
69+
}
70+
/* c8 ignore stop */
6371
const root = r || (0, path_1.parse)(file).root || '.';
6472
let ret;
6573
if (file === root)
6674
ret = false;
6775
else {
6876
const m = map.get(file);
69-
ret = m !== undefined ? m : mapHas((0, path_1.dirname)(file), root);
77+
ret = m !== undefined ? m : mapHas((0, path_1.dirname)(file), root, depth + 1);
7078
}
7179
map.set(file, ret);
7280
return ret;

‎node_modules/tar/dist/commonjs/parse.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,16 @@ class Parser extends events_1.EventEmitter {
376376
if (this[ABORTED]) {
377377
return;
378378
}
379+
if (this[UNZIP]) {
380+
// fully nerf the decompressor and close its underlying binding
381+
const u = this[UNZIP];
382+
/* c8 ignore start */
383+
u.write = () => true;
384+
u.end = () => u;
385+
u.emit = () => false;
386+
/* c8 ignore stop */
387+
u.destroy?.();
388+
}
379389
this[ABORTED] = true;
380390
this.emit('abort', error);
381391
// always throws, even in non-strict mode

‎node_modules/tar/dist/esm/index.min.js‎

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

‎node_modules/tar/dist/esm/list.js‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,22 @@ const onReadEntryFunction = (opt) => {
2020
export const filesFilter = (opt, files) => {
2121
const map = new Map(files.map(f => [stripTrailingSlashes(f), true]));
2222
const filter = opt.filter;
23-
const mapHas = (file, r = '') => {
23+
// limit recursion to 100 levels
24+
const MAX = 100;
25+
const mapHas = (file, r = '', depth = 0) => {
26+
/* c8 ignore start - excessive caution */
27+
if (depth >= MAX) {
28+
map.set(file, false);
29+
return false;
30+
}
31+
/* c8 ignore stop */
2432
const root = r || parse(file).root || '.';
2533
let ret;
2634
if (file === root)
2735
ret = false;
2836
else {
2937
const m = map.get(file);
30-
ret = m !== undefined ? m : mapHas(dirname(file), root);
38+
ret = m !== undefined ? m : mapHas(dirname(file), root, depth + 1);
3139
}
3240
map.set(file, ret);
3341
return ret;

‎node_modules/tar/dist/esm/parse.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,16 @@ export class Parser extends EE {
373373
if (this[ABORTED]) {
374374
return;
375375
}
376+
if (this[UNZIP]) {
377+
// fully nerf the decompressor and close its underlying binding
378+
const u = this[UNZIP];
379+
/* c8 ignore start */
380+
u.write = () => true;
381+
u.end = () => u;
382+
u.emit = () => false;
383+
/* c8 ignore stop */
384+
u.destroy?.();
385+
}
376386
this[ABORTED] = true;
377387
this.emit('abort', error);
378388
// always throws, even in non-strict mode

‎node_modules/tar/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "Isaac Z. Schlueter",
33
"name": "tar",
44
"description": "tar for node",
5-
"version": "7.5.19",
5+
"version": "7.5.22",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/isaacs/node-tar.git"

‎package-lock.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"spdx-expression-parse": "^4.0.0",
143143
"ssri": "^13.0.1",
144144
"supports-color": "^10.2.2",
145-
"tar": "^7.5.19",
145+
"tar": "^7.5.22",
146146
"text-table": "~0.2.0",
147147
"tiny-relative-date": "^2.0.2",
148148
"treeverse": "^3.0.0",
@@ -13228,9 +13228,9 @@
1322813228
}
1322913229
},
1323013230
"node_modules/tar": {
13231-
"version": "7.5.19",
13232-
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.19.tgz",
13233-
"integrity": "sha512-4LeEWl96twnS2Q7Bz4MGqgazLqO+hJN63GZxXoIqh1T3VweYD997gbU1ItNsQafqqXTXd5WFyFdReLtwvRBNiw==",
13231+
"version": "7.5.22",
13232+
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.22.tgz",
13233+
"integrity": "sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==",
1323413234
"inBundle": true,
1323513235
"license": "BlueOak-1.0.0",
1323613236
"dependencies": {

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"spdx-expression-parse": "^4.0.0",
111111
"ssri": "^13.0.1",
112112
"supports-color": "^10.2.2",
113-
"tar": "^7.5.19",
113+
"tar": "^7.5.22",
114114
"text-table": "~0.2.0",
115115
"tiny-relative-date": "^2.0.2",
116116
"treeverse": "^3.0.0",

0 commit comments

Comments
 (0)