Skip to content

Commit 75a943d

Browse files
martinrrmCopilot
andauthored
deps: tar@7.5.22 (#9843)
## Summary Updates the bundled `tar` dependency from `7.5.19` to `7.5.22` on the latest npm 12 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 `tar@7.5.22`. ## 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 <223556219+Copilot@users.noreply.github.com>
1 parent a8c9b2f commit 75a943d

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
@@ -148,7 +148,7 @@
148148
"spdx-expression-parse": "^4.0.0",
149149
"ssri": "^14.0.0",
150150
"supports-color": "^10.2.2",
151-
"tar": "^7.5.19",
151+
"tar": "^7.5.22",
152152
"text-table": "~0.2.0",
153153
"tiny-relative-date": "^2.0.2",
154154
"treeverse": "^3.0.0",
@@ -13779,9 +13779,9 @@
1377913779
}
1378013780
},
1378113781
"node_modules/tar": {
13782-
"version": "7.5.19",
13783-
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.19.tgz",
13784-
"integrity": "sha512-4LeEWl96twnS2Q7Bz4MGqgazLqO+hJN63GZxXoIqh1T3VweYD997gbU1ItNsQafqqXTXd5WFyFdReLtwvRBNiw==",
13782+
"version": "7.5.22",
13783+
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.22.tgz",
13784+
"integrity": "sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==",
1378513785
"inBundle": true,
1378613786
"license": "BlueOak-1.0.0",
1378713787
"dependencies": {

package.json

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

0 commit comments

Comments
 (0)