Skip to content

fix(arborist): strip path separators from version in store key#9758

Open
ubeddulla wants to merge 1 commit into
npm:latestfrom
ubeddulla:isolated-store-key-version
Open

fix(arborist): strip path separators from version in store key#9758
ubeddulla wants to merge 1 commit into
npm:latestfrom
ubeddulla:isolated-store-key-version

Conversation

@ubeddulla

Copy link
Copy Markdown
Contributor
  1. In linked/isolated mode getKey builds the .store key as name@version-hash; packageName is already run through nameFromFolder (per the comment right above it) but version is interpolated raw.
  2. version is package.version straight from a dependency manifest, and the key becomes a path segment in join('node_modules', '.store', key, ...), so a git/file/tarball dep with a version like 1.0.0/../../../../tmp/x lets path.join collapse the .. and escape the store before pacote.extract writes there.

Stripped / and \ from version in getKey, matching the existing packageName handling. Valid semver has no separators so store keys are unchanged, and the isolated-mode suite stays green.

@ubeddulla ubeddulla requested review from a team as code owners July 13, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant