@pnpm/deps.graph-builder 1100.0.19 → 1100.0.20

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.
@@ -4,6 +4,7 @@ import { packageIsInstallable } from '@pnpm/config.package-is-installable';
4
4
  import { WANTED_LOCKFILE } from '@pnpm/constants';
5
5
  import { progressLogger, } from '@pnpm/core-loggers';
6
6
  import * as dp from '@pnpm/deps.path';
7
+ import { safeJoinModulesDir } from '@pnpm/fs.symlink-dependency';
7
8
  import { packageIdFromSnapshot, pkgSnapshotToResolution, } from '@pnpm/lockfile.utils';
8
9
  import { logger } from '@pnpm/logger';
9
10
  import { getPatchInfo } from '@pnpm/patching.config';
@@ -102,7 +103,11 @@ async function buildGraphFromPackages(lockfile, currentLockfile, opts) {
102
103
  equals(currentPackages[depPath].dependencies, pkgSnapshot.dependencies);
103
104
  const depIntegrityIsUnchanged = isIntegrityEqual(pkgSnapshot.resolution, currentPackages[depPath]?.resolution);
104
105
  const modules = path.join(dirInVirtualStore, 'node_modules');
105
- const dir = path.join(modules, pkgName);
106
+ // `pkgName` is reconstructed from the (attacker-controllable) lockfile
107
+ // depPath key via `dp.parse`, which does no validation. Contain it here so
108
+ // a traversal name (e.g. `../../../tmp/x`) can't make the package import
109
+ // escape the virtual store. Mirrors the guard on the hoisted linker.
110
+ const dir = safeJoinModulesDir(modules, pkgName);
106
111
  locationByDepPath[depPath] = dir;
107
112
  // Track directory deps for injected workspace packages
108
113
  if (isDirectoryDep) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/deps.graph-builder",
3
- "version": "1100.0.19",
3
+ "version": "1100.0.20",
4
4
  "description": "A package for building a dependency graph from a lockfile",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -31,24 +31,26 @@
31
31
  "ramda": "npm:@pnpm/ramda@0.28.1",
32
32
  "@pnpm/config.package-is-installable": "1100.0.12",
33
33
  "@pnpm/constants": "1100.0.0",
34
- "@pnpm/deps.graph-hasher": "1100.2.7",
34
+ "@pnpm/core-loggers": "1100.2.1",
35
+ "@pnpm/deps.graph-hasher": "1100.2.8",
35
36
  "@pnpm/deps.path": "1100.0.8",
36
- "@pnpm/lockfile.fs": "1100.1.8",
37
+ "@pnpm/fs.symlink-dependency": "1100.0.10",
37
38
  "@pnpm/lockfile.utils": "1100.1.1",
39
+ "@pnpm/lockfile.fs": "1100.1.9",
38
40
  "@pnpm/installing.modules-yaml": "1100.0.9",
39
41
  "@pnpm/patching.types": "1100.0.0",
40
- "@pnpm/store.controller-types": "1100.1.7",
42
+ "@pnpm/patching.config": "1100.0.9",
41
43
  "@pnpm/types": "1101.3.2",
42
- "@pnpm/core-loggers": "1100.2.1",
43
44
  "@pnpm/hooks.types": "1100.1.1",
44
- "@pnpm/patching.config": "1100.0.9"
45
+ "@pnpm/store.controller-types": "1100.1.7"
45
46
  },
46
47
  "peerDependencies": {
47
48
  "@pnpm/logger": "^1100.0.0"
48
49
  },
49
50
  "devDependencies": {
51
+ "@jest/globals": "30.4.1",
50
52
  "@types/ramda": "0.31.1",
51
- "@pnpm/deps.graph-builder": "1100.0.19",
53
+ "@pnpm/deps.graph-builder": "1100.0.20",
52
54
  "@pnpm/logger": "1100.0.0"
53
55
  },
54
56
  "engines": {
@@ -58,8 +60,9 @@
58
60
  "preset": "@pnpm/jest-config"
59
61
  },
60
62
  "scripts": {
61
- "lint": "eslint \"src/**/*.ts\"",
62
- "test": "pn compile",
63
- "compile": "tsgo --build && pn lint --fix"
63
+ "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
64
+ "test": "pn compile && pn .test",
65
+ "compile": "tsgo --build && pn lint --fix",
66
+ ".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
64
67
  }
65
68
  }