pnpm 10.34.1 → 10.34.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/node_modules/.modules.yaml +75 -75
  2. package/dist/node_modules/.pnpm/lock.yaml +16 -14
  3. package/dist/node_modules/.pnpm-workspace-state-v1.json +3 -1
  4. package/dist/node_modules/semver/classes/range.js +11 -2
  5. package/dist/node_modules/semver/classes/semver.js +19 -2
  6. package/dist/node_modules/semver/package.json +2 -2
  7. package/dist/node_modules/tar/dist/commonjs/header.d.ts.map +1 -1
  8. package/dist/node_modules/tar/dist/commonjs/header.js +51 -16
  9. package/dist/node_modules/tar/dist/commonjs/header.js.map +1 -1
  10. package/dist/node_modules/tar/dist/commonjs/index.min.js +3 -3
  11. package/dist/node_modules/tar/dist/commonjs/index.min.js.map +3 -3
  12. package/dist/node_modules/tar/dist/commonjs/pack.d.ts.map +1 -1
  13. package/dist/node_modules/tar/dist/commonjs/pack.js +4 -5
  14. package/dist/node_modules/tar/dist/commonjs/pack.js.map +1 -1
  15. package/dist/node_modules/tar/dist/commonjs/types.d.ts.map +1 -1
  16. package/dist/node_modules/tar/dist/commonjs/types.js +21 -1
  17. package/dist/node_modules/tar/dist/commonjs/types.js.map +1 -1
  18. package/dist/node_modules/tar/dist/esm/header.d.ts.map +1 -1
  19. package/dist/node_modules/tar/dist/esm/header.js +51 -16
  20. package/dist/node_modules/tar/dist/esm/header.js.map +1 -1
  21. package/dist/node_modules/tar/dist/esm/index.min.js +3 -3
  22. package/dist/node_modules/tar/dist/esm/index.min.js.map +3 -3
  23. package/dist/node_modules/tar/dist/esm/pack.d.ts.map +1 -1
  24. package/dist/node_modules/tar/dist/esm/pack.js +4 -5
  25. package/dist/node_modules/tar/dist/esm/pack.js.map +1 -1
  26. package/dist/node_modules/tar/dist/esm/types.d.ts.map +1 -1
  27. package/dist/node_modules/tar/dist/esm/types.js +20 -0
  28. package/dist/node_modules/tar/dist/esm/types.js.map +1 -1
  29. package/dist/node_modules/tar/package.json +11 -10
  30. package/dist/node_modules/tinyglobby/dist/index.cjs +19 -18
  31. package/dist/node_modules/tinyglobby/dist/index.d.cts +1 -1
  32. package/dist/node_modules/tinyglobby/dist/index.d.mts +1 -1
  33. package/dist/node_modules/tinyglobby/dist/index.mjs +9 -8
  34. package/dist/node_modules/tinyglobby/package.json +9 -12
  35. package/dist/pnpm.cjs +11080 -782
  36. package/package.json +1 -1
@@ -19,28 +19,28 @@
19
19
  "nopt@8.1.0": [
20
20
  "node_modules/nopt"
21
21
  ],
22
- "env-paths@2.2.1": [
23
- "node_modules/env-paths"
24
- ],
25
- "proc-log@5.0.0": [
26
- "node_modules/proc-log"
22
+ "tar@7.5.16": [
23
+ "node_modules/tar"
27
24
  ],
28
- "tinyglobby@0.2.16": [
25
+ "tinyglobby@0.2.17": [
29
26
  "node_modules/tinyglobby"
30
27
  ],
31
28
  "which@5.0.0": [
32
29
  "node_modules/which"
33
30
  ],
31
+ "env-paths@2.2.1": [
32
+ "node_modules/env-paths"
33
+ ],
34
+ "proc-log@5.0.0": [
35
+ "node_modules/proc-log"
36
+ ],
34
37
  "exponential-backoff@3.1.3": [
35
38
  "node_modules/exponential-backoff"
36
39
  ],
37
40
  "graceful-fs@4.2.11": [
38
41
  "node_modules/graceful-fs"
39
42
  ],
40
- "tar@7.5.15": [
41
- "node_modules/tar"
42
- ],
43
- "semver@7.8.1": [
43
+ "semver@7.8.4": [
44
44
  "node_modules/semver"
45
45
  ],
46
46
  "make-fetch-happen@14.0.3": [
@@ -49,30 +49,33 @@
49
49
  "abbrev@3.0.1": [
50
50
  "node_modules/abbrev"
51
51
  ],
52
- "picomatch@4.0.4": [
53
- "node_modules/picomatch"
54
- ],
55
- "fdir@6.5.0(picomatch@4.0.4)": [
56
- "node_modules/fdir"
57
- ],
58
- "isexe@3.1.1": [
59
- "node_modules/isexe"
52
+ "chownr@3.0.0": [
53
+ "node_modules/chownr"
60
54
  ],
61
55
  "yallist@5.0.0": [
62
56
  "node_modules/yallist"
63
57
  ],
64
- "chownr@3.0.0": [
65
- "node_modules/chownr"
58
+ "@isaacs/fs-minipass@4.0.1": [
59
+ "node_modules/@isaacs/fs-minipass"
66
60
  ],
67
61
  "minizlib@3.1.0": [
68
62
  "node_modules/minizlib"
69
63
  ],
70
- "@isaacs/fs-minipass@4.0.1": [
71
- "node_modules/@isaacs/fs-minipass"
72
- ],
73
64
  "minipass@7.1.3": [
74
65
  "node_modules/minipass"
75
66
  ],
67
+ "fdir@6.5.0(picomatch@4.0.4)": [
68
+ "node_modules/fdir"
69
+ ],
70
+ "picomatch@4.0.4": [
71
+ "node_modules/picomatch"
72
+ ],
73
+ "isexe@3.1.1": [
74
+ "node_modules/isexe"
75
+ ],
76
+ "promise-retry@2.0.1": [
77
+ "node_modules/promise-retry"
78
+ ],
76
79
  "minipass@3.3.6": [
77
80
  "node_modules/minipass-flush/node_modules/minipass",
78
81
  "node_modules/minipass-pipeline/node_modules/minipass",
@@ -86,108 +89,114 @@
86
89
  "negotiator@1.0.0": [
87
90
  "node_modules/negotiator"
88
91
  ],
89
- "promise-retry@2.0.1": [
90
- "node_modules/promise-retry"
92
+ "minipass-fetch@4.0.1": [
93
+ "node_modules/minipass-fetch"
91
94
  ],
92
95
  "@npmcli/agent@3.0.0": [
93
96
  "node_modules/@npmcli/agent"
94
97
  ],
95
- "ssri@12.0.0": [
96
- "node_modules/ssri"
97
- ],
98
98
  "http-cache-semantics@4.2.0": [
99
99
  "node_modules/http-cache-semantics"
100
100
  ],
101
- "minipass-fetch@4.0.1": [
102
- "node_modules/minipass-fetch"
103
- ],
104
101
  "cacache@19.0.1": [
105
102
  "node_modules/cacache"
106
103
  ],
107
- "err-code@2.0.3": [
108
- "node_modules/err-code"
104
+ "ssri@12.0.0": [
105
+ "node_modules/ssri"
109
106
  ],
110
107
  "retry@0.12.0": [
111
108
  "node_modules/retry"
112
109
  ],
110
+ "err-code@2.0.3": [
111
+ "node_modules/err-code"
112
+ ],
113
+ "encoding@0.1.13": [
114
+ "node_modules/encoding"
115
+ ],
113
116
  "http-proxy-agent@7.0.2": [
114
117
  "node_modules/http-proxy-agent"
115
118
  ],
116
- "agent-base@7.1.4": [
117
- "node_modules/agent-base"
118
- ],
119
119
  "https-proxy-agent@7.0.6": [
120
120
  "node_modules/https-proxy-agent"
121
121
  ],
122
122
  "socks-proxy-agent@8.0.5": [
123
123
  "node_modules/socks-proxy-agent"
124
124
  ],
125
+ "agent-base@7.1.4": [
126
+ "node_modules/agent-base"
127
+ ],
125
128
  "lru-cache@10.4.3": [
126
129
  "node_modules/lru-cache"
127
130
  ],
128
- "encoding@0.1.13": [
129
- "node_modules/encoding"
130
- ],
131
- "unique-filename@4.0.0": [
132
- "node_modules/unique-filename"
133
- ],
134
131
  "fs-minipass@3.0.3": [
135
132
  "node_modules/fs-minipass"
136
133
  ],
137
134
  "minipass-collect@2.0.1": [
138
135
  "node_modules/minipass-collect"
139
136
  ],
140
- "p-map@7.0.4": [
141
- "node_modules/p-map"
137
+ "unique-filename@4.0.0": [
138
+ "node_modules/unique-filename"
142
139
  ],
143
140
  "@npmcli/fs@4.0.0": [
144
141
  "node_modules/@npmcli/fs"
145
142
  ],
143
+ "p-map@7.0.4": [
144
+ "node_modules/p-map"
145
+ ],
146
146
  "glob@10.5.0": [
147
147
  "node_modules/glob"
148
148
  ],
149
+ "iconv-lite@0.6.3": [
150
+ "node_modules/iconv-lite"
151
+ ],
149
152
  "debug@4.4.3": [
150
153
  "node_modules/debug"
151
154
  ],
152
155
  "socks@2.8.9": [
153
156
  "node_modules/socks"
154
157
  ],
155
- "iconv-lite@0.6.3": [
156
- "node_modules/iconv-lite"
157
- ],
158
158
  "unique-slug@5.0.0": [
159
159
  "node_modules/unique-slug"
160
160
  ],
161
+ "foreground-child@3.3.1": [
162
+ "node_modules/foreground-child"
163
+ ],
161
164
  "package-json-from-dist@1.0.1": [
162
165
  "node_modules/package-json-from-dist"
163
166
  ],
164
- "path-scurry@1.11.1": [
165
- "node_modules/path-scurry"
166
- ],
167
167
  "jackspeak@3.4.3": [
168
168
  "node_modules/jackspeak"
169
169
  ],
170
+ "path-scurry@1.11.1": [
171
+ "node_modules/path-scurry"
172
+ ],
170
173
  "minimatch@9.0.9": [
171
174
  "node_modules/minimatch"
172
175
  ],
173
- "foreground-child@3.3.1": [
174
- "node_modules/foreground-child"
176
+ "safer-buffer@2.1.2": [
177
+ "node_modules/safer-buffer"
175
178
  ],
176
179
  "ms@2.1.3": [
177
180
  "node_modules/ms"
178
181
  ],
179
- "smart-buffer@4.2.0": [
180
- "node_modules/smart-buffer"
181
- ],
182
182
  "ip-address@10.2.0": [
183
183
  "node_modules/ip-address"
184
184
  ],
185
- "safer-buffer@2.1.2": [
186
- "node_modules/safer-buffer"
185
+ "smart-buffer@4.2.0": [
186
+ "node_modules/smart-buffer"
187
187
  ],
188
188
  "imurmurhash@0.1.4": [
189
189
  "node_modules/imurmurhash"
190
190
  ],
191
+ "signal-exit@4.1.0": [
192
+ "node_modules/signal-exit"
193
+ ],
194
+ "which@2.0.2": [
195
+ "node_modules/cross-spawn/node_modules/which"
196
+ ],
197
+ "isexe@2.0.0": [
198
+ "node_modules/cross-spawn/node_modules/isexe"
199
+ ],
191
200
  "@isaacs/cliui@8.0.2": [
192
201
  "node_modules/@isaacs/cliui"
193
202
  ],
@@ -197,14 +206,11 @@
197
206
  "brace-expansion@2.1.1": [
198
207
  "node_modules/brace-expansion"
199
208
  ],
200
- "signal-exit@4.1.0": [
201
- "node_modules/signal-exit"
202
- ],
203
- "which@2.0.2": [
204
- "node_modules/cross-spawn/node_modules/which"
209
+ "shebang-command@2.0.0": [
210
+ "node_modules/shebang-command"
205
211
  ],
206
- "isexe@2.0.0": [
207
- "node_modules/cross-spawn/node_modules/isexe"
212
+ "path-key@3.1.1": [
213
+ "node_modules/path-key"
208
214
  ],
209
215
  "strip-ansi@7.2.0": [
210
216
  "node_modules/strip-ansi"
@@ -239,11 +245,8 @@
239
245
  "balanced-match@1.0.2": [
240
246
  "node_modules/balanced-match"
241
247
  ],
242
- "shebang-command@2.0.0": [
243
- "node_modules/shebang-command"
244
- ],
245
- "path-key@3.1.1": [
246
- "node_modules/path-key"
248
+ "shebang-regex@3.0.0": [
249
+ "node_modules/shebang-regex"
247
250
  ],
248
251
  "ansi-regex@6.2.2": [
249
252
  "node_modules/ansi-regex"
@@ -257,14 +260,11 @@
257
260
  "color-convert@2.0.1": [
258
261
  "node_modules/color-convert"
259
262
  ],
260
- "eastasianwidth@0.2.0": [
261
- "node_modules/eastasianwidth"
262
- ],
263
263
  "emoji-regex@9.2.2": [
264
264
  "node_modules/emoji-regex"
265
265
  ],
266
- "shebang-regex@3.0.0": [
267
- "node_modules/shebang-regex"
266
+ "eastasianwidth@0.2.0": [
267
+ "node_modules/eastasianwidth"
268
268
  ],
269
269
  "color-name@1.1.4": [
270
270
  "node_modules/color-name"
@@ -289,7 +289,7 @@
289
289
  "packageManager": "pnpm@10.33.1",
290
290
  "pendingBuilds": [],
291
291
  "publicHoistPattern": [],
292
- "prunedAt": "Wed, 27 May 2026 23:03:26 GMT",
292
+ "prunedAt": "Thu, 11 Jun 2026 17:03:03 GMT",
293
293
  "registries": {
294
294
  "default": "https://registry.npmjs.org/",
295
295
  "@jsr": "https://npm.jsr.io/"
@@ -42,6 +42,8 @@ overrides:
42
42
  semver@<7.5.2: ^7.7.4
43
43
  send@<0.19.0: ^0.19.0
44
44
  serve-static@<1.16.0: ^1.16.0
45
+ shell-quote@<1.8.4: '>=1.8.4'
46
+ shell-quote: 1.8.4
45
47
  socks@2: ^2.8.1
46
48
  tar@<=7.5.10: '>=7.5.11'
47
49
  tmp@<0.2.6: '>=0.2.6'
@@ -319,8 +321,8 @@ packages:
319
321
  safer-buffer@2.1.2:
320
322
  resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
321
323
 
322
- semver@7.8.1:
323
- resolution: {integrity: sha512-rkVq3IXh+4FDGch+KwzX3aV9W3kO54GyEgpvBzSyctDA6Xtd7RJQV1xmXbeQp5v7+VzLOfVqiutSE6GICgPFvg==}
324
+ semver@7.8.4:
325
+ resolution: {integrity: sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==}
324
326
  engines: {node: '>=10'}
325
327
  hasBin: true
326
328
 
@@ -368,12 +370,12 @@ packages:
368
370
  resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==}
369
371
  engines: {node: '>=12'}
370
372
 
371
- tar@7.5.15:
372
- resolution: {integrity: sha512-dzGK0boVlC4W5QFuQN1EFSl3bIDYsk7Tj40U6eIBnK2k/8ml7TZ5agbI5j5+qnoVcAA+rNtBml8SEiLxZpNqRQ==}
373
+ tar@7.5.16:
374
+ resolution: {integrity: sha512-56adEpPMouktRlBLXiaYFFzZ/3+JXa8P9n7WbR+ibIjtviN55mEaOkiysCnPnWm+7kkui1Dn8J9l+g6zV8731w==}
373
375
  engines: {node: '>=18'}
374
376
 
375
- tinyglobby@0.2.16:
376
- resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==}
377
+ tinyglobby@0.2.17:
378
+ resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
377
379
  engines: {node: '>=12.0.0'}
378
380
 
379
381
  unique-filename@4.0.0:
@@ -442,7 +444,7 @@ snapshots:
442
444
 
443
445
  '@npmcli/fs@4.0.0':
444
446
  dependencies:
445
- semver: 7.8.1
447
+ semver: 7.8.4
446
448
  optional: true
447
449
 
448
450
  '@pkgjs/parseargs@0.11.0':
@@ -488,7 +490,7 @@ snapshots:
488
490
  minipass-pipeline: 1.2.4
489
491
  p-map: 7.0.4
490
492
  ssri: 12.0.0
491
- tar: 7.5.15
493
+ tar: 7.5.16
492
494
  unique-filename: 4.0.0
493
495
  optional: true
494
496
 
@@ -694,9 +696,9 @@ snapshots:
694
696
  make-fetch-happen: 14.0.3
695
697
  nopt: 8.1.0
696
698
  proc-log: 5.0.0
697
- semver: 7.8.1
698
- tar: 7.5.15
699
- tinyglobby: 0.2.16
699
+ semver: 7.8.4
700
+ tar: 7.5.16
701
+ tinyglobby: 0.2.17
700
702
  which: 5.0.0
701
703
  transitivePeerDependencies:
702
704
  - supports-color
@@ -740,7 +742,7 @@ snapshots:
740
742
  safer-buffer@2.1.2:
741
743
  optional: true
742
744
 
743
- semver@7.8.1:
745
+ semver@7.8.4:
744
746
  optional: true
745
747
 
746
748
  shebang-command@2.0.0:
@@ -801,7 +803,7 @@ snapshots:
801
803
  ansi-regex: 6.2.2
802
804
  optional: true
803
805
 
804
- tar@7.5.15:
806
+ tar@7.5.16:
805
807
  dependencies:
806
808
  '@isaacs/fs-minipass': 4.0.1
807
809
  chownr: 3.0.0
@@ -810,7 +812,7 @@ snapshots:
810
812
  yallist: 5.0.0
811
813
  optional: true
812
814
 
813
- tinyglobby@0.2.16:
815
+ tinyglobby@0.2.17:
814
816
  dependencies:
815
817
  fdir: 6.5.0(picomatch@4.0.4)
816
818
  picomatch: 4.0.4
@@ -1,5 +1,5 @@
1
1
  {
2
- "lastValidatedTimestamp": 1779923006425,
2
+ "lastValidatedTimestamp": 1781197383368,
3
3
  "projects": {},
4
4
  "pnpmfiles": [],
5
5
  "settings": {
@@ -56,6 +56,8 @@
56
56
  "semver@<7.5.2": "^7.7.4",
57
57
  "send@<0.19.0": "^0.19.0",
58
58
  "serve-static@<1.16.0": "^1.16.0",
59
+ "shell-quote@<1.8.4": ">=1.8.4",
60
+ "shell-quote": "1.8.4",
59
61
  "socks@2": "^2.8.1",
60
62
  "tar@<=7.5.10": ">=7.5.11",
61
63
  "tmp@<0.2.6": ">=0.2.6",
@@ -277,6 +277,11 @@ const parseComparator = (comp, options) => {
277
277
 
278
278
  const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
279
279
 
280
+ const invalidXRangeOrder = (M, m, p) => (
281
+ (isX(M) && !isX(m)) ||
282
+ (isX(m) && p && !isX(p))
283
+ )
284
+
280
285
  // ~, ~> --> * (any, kinda silly)
281
286
  // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
282
287
  // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
@@ -373,10 +378,10 @@ const replaceCaret = (comp, options) => {
373
378
  if (M === '0') {
374
379
  if (m === '0') {
375
380
  ret = `>=${M}.${m}.${p
376
- }${z} <${M}.${m}.${+p + 1}-0`
381
+ } <${M}.${m}.${+p + 1}-0`
377
382
  } else {
378
383
  ret = `>=${M}.${m}.${p
379
- }${z} <${M}.${+m + 1}.0-0`
384
+ } <${M}.${+m + 1}.0-0`
380
385
  }
381
386
  } else {
382
387
  ret = `>=${M}.${m}.${p
@@ -402,6 +407,10 @@ const replaceXRange = (comp, options) => {
402
407
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
403
408
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
404
409
  debug('xRange', comp, ret, gtlt, M, m, p, pr)
410
+ if (invalidXRangeOrder(M, m, p)) {
411
+ return comp
412
+ }
413
+
405
414
  const xM = isX(M)
406
415
  const xm = xM || isX(m)
407
416
  const xp = xm || isX(p)
@@ -6,6 +6,22 @@ const { safeRe: re, t } = require('../internal/re')
6
6
 
7
7
  const parseOptions = require('../internal/parse-options')
8
8
  const { compareIdentifiers } = require('../internal/identifiers')
9
+
10
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
11
+ const identifiers = identifier.split('.')
12
+ if (identifiers.length > prerelease.length) {
13
+ return false
14
+ }
15
+
16
+ for (let i = 0; i < identifiers.length; i++) {
17
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
18
+ return false
19
+ }
20
+ }
21
+
22
+ return true
23
+ }
24
+
9
25
  class SemVer {
10
26
  constructor (version, options) {
11
27
  options = parseOptions(options)
@@ -309,8 +325,9 @@ class SemVer {
309
325
  if (identifierBase === false) {
310
326
  prerelease = [identifier]
311
327
  }
312
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
313
- if (isNaN(this.prerelease[1])) {
328
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
329
+ const prereleaseBase = this.prerelease[identifier.split('.').length]
330
+ if (isNaN(prereleaseBase)) {
314
331
  this.prerelease = prerelease
315
332
  }
316
333
  } else {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "7.8.1",
3
+ "version": "7.8.4",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
15
15
  },
16
16
  "devDependencies": {
17
- "@npmcli/eslint-config": "^6.0.0",
17
+ "@npmcli/eslint-config": "^7.0.0",
18
18
  "@npmcli/template-oss": "5.0.0",
19
19
  "benchmark": "^2.1.4",
20
20
  "tap": "^16.0.0"
@@ -1 +1 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/header.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG9D,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAA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,GAAG,GAAE,MAAU;IAiEpC,IAAI,IAAI,IAAI,aAAa,CAKxB;IAED,IAAI,OAAO,IAAI,aAAa,GAAG,aAAa,CAE3C;IAED,IAAI,IAAI,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,aAAa,EAS3D;CACF"}
@@ -78,22 +78,45 @@ class Header {
78
78
  if (!buf || !(buf.length >= off + 512)) {
79
79
  throw new Error('need 512 bytes for header');
80
80
  }
81
- this.path = ex?.path ?? decString(buf, off, 100);
82
- this.mode = ex?.mode ?? gex?.mode ?? decNumber(buf, off + 100, 8);
83
- this.uid = ex?.uid ?? gex?.uid ?? decNumber(buf, off + 108, 8);
84
- this.gid = ex?.gid ?? gex?.gid ?? decNumber(buf, off + 116, 8);
85
- this.size = ex?.size ?? gex?.size ?? decNumber(buf, off + 124, 12);
86
- this.mtime = ex?.mtime ?? gex?.mtime ?? decDate(buf, off + 136, 12);
81
+ // Decode the typeflag (independent of any pending PAX/GNU extended header)
82
+ // up front so we can tell whether THIS block is itself an intermediary
83
+ // extension header (PAX `x`/`g`, GNU long-name `L`, GNU long-link `K`).
84
+ // Per POSIX pax, a PAX extended header describes the *next file entry*, not
85
+ // the extension headers that may sit between it and that file. Applying the
86
+ // pending PAX overrides (notably `size`) to an intervening `L`/`K`/`x`/`g`
87
+ // header desynchronizes the stream relative to other tar implementations
88
+ // and enables tar interpretation-conflict / file-smuggling attacks.
89
+ const t = decString(buf, off + 156, 1);
90
+ const isNormalFS = types.normalFsTypes.has(t);
91
+ const exForFields = isNormalFS ? ex : undefined;
92
+ const gexForFields = isNormalFS ? gex : undefined;
93
+ this.path = exForFields?.path ?? decString(buf, off, 100);
94
+ this.mode =
95
+ exForFields?.mode ??
96
+ gexForFields?.mode ??
97
+ decNumber(buf, off + 100, 8);
98
+ this.uid =
99
+ exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8);
100
+ this.gid =
101
+ exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8);
102
+ this.size =
103
+ exForFields?.size ??
104
+ gexForFields?.size ??
105
+ decNumber(buf, off + 124, 12);
106
+ this.mtime =
107
+ exForFields?.mtime ??
108
+ gexForFields?.mtime ??
109
+ decDate(buf, off + 136, 12);
87
110
  this.cksum = decNumber(buf, off + 148, 12);
88
111
  // if we have extended or global extended headers, apply them now
89
112
  // See https://github.com/npm/node-tar/pull/187
90
- // Apply global before local, so it overrides
91
- if (gex)
92
- this.#slurp(gex, true);
93
- if (ex)
94
- this.#slurp(ex);
113
+ // Apply global before local, so it overrides. Never slurp the pending
114
+ // extended-header fields onto an intermediary extension header.
115
+ if (gexForFields)
116
+ this.#slurp(gexForFields, true);
117
+ if (exForFields)
118
+ this.#slurp(exForFields);
95
119
  // old tar versions marked dirs as a file with a trailing /
96
- const t = decString(buf, off + 156, 1);
97
120
  if (types.isCode(t)) {
98
121
  this.#type = t || '0';
99
122
  }
@@ -111,12 +134,24 @@ class Header {
111
134
  this.linkpath = decString(buf, off + 157, 100);
112
135
  if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') {
113
136
  /* c8 ignore start */
114
- this.uname = ex?.uname ?? gex?.uname ?? decString(buf, off + 265, 32);
115
- this.gname = ex?.gname ?? gex?.gname ?? decString(buf, off + 297, 32);
137
+ this.uname =
138
+ exForFields?.uname ??
139
+ gexForFields?.uname ??
140
+ decString(buf, off + 265, 32);
141
+ this.gname =
142
+ exForFields?.gname ??
143
+ gexForFields?.gname ??
144
+ decString(buf, off + 297, 32);
116
145
  this.devmaj =
117
- ex?.devmaj ?? gex?.devmaj ?? decNumber(buf, off + 329, 8) ?? 0;
146
+ exForFields?.devmaj ??
147
+ gexForFields?.devmaj ??
148
+ decNumber(buf, off + 329, 8) ??
149
+ 0;
118
150
  this.devmin =
119
- ex?.devmin ?? gex?.devmin ?? decNumber(buf, off + 337, 8) ?? 0;
151
+ exForFields?.devmin ??
152
+ gexForFields?.devmin ??
153
+ decNumber(buf, off + 337, 8) ??
154
+ 0;
120
155
  /* c8 ignore stop */
121
156
  if (buf[off + 475] !== 0) {
122
157
  // definitely a prefix, definitely >130 chars.