Skip to content

fix(security): contain the rebuild pkg root against a traversal depPath name - #13596

Merged
zkochan merged 4 commits into
mainfrom
vuln-c59q
Aug 3, 2026
Merged

zkochan merged 4 commits into
mainfrom
vuln-c59q

Conversation

@zkochan

@zkochan zkochan commented Aug 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to 51300fd41c (GHSA-c59q-g84q-2gj5, GHSA-vq4v-j7r6-jq4m, GHSA-2rx9-3g3h-c2jv).

The GHSA-c59q-g84q-2gj5 report listed three sinks that join a lockfile-derived package name onto a directory. 51300fd41c contained two of them — the isolated linker (lockfileToDepGraph) and the PnP packageLocation — and both are covered by regression tests. The third, the rebuild phase, was missed.

_rebuild in @pnpm/building.after-install reads the current lockfile from node_modules and builds the package root as path.join(pkgModulesDir(depPath), pkgInfo.name), where pkgInfo.name comes from dp.parse() of the packages key. dp.parse() is a raw substring with no validation, so a key like ../../../[email protected] pointed the lifecycle-script runner (and the post-build .bin linking a few lines down) at a directory outside the virtual store. The dep graph that phase walks is built by @pnpm/deps.graph-hasher, which deliberately defers the package-name check to its sink — and this sink had none.

Both joins now go through safeJoinModulesDir, so a crafted name fails with ERR_PNPM_INVALID_DEPENDENCY_NAME before any script runs.

Reachability is narrower than the install path the advisory described: the poisoned lockfile has to already be inside node_modules/.pnpm/lock.yaml, which means a shipped or CI-restored node_modules, not a committed pnpm-lock.yaml. It is a defence-in-depth gap rather than a live repeat of the original bug, but it is the exact sink the report asked to close.

Squash Commit Body

GHSA-c59q-g84q-2gj5 reported that the isolated linker joined the
lockfile-derived package name onto the virtual store without validation.
That site, and the PnP `packageLocation`, were already contained by
51300fd41c; the one recommended site that commit missed is the rebuild
phase, which resolves its package root the same way.

`_rebuild` reads the current lockfile from `node_modules` and rebuilds
`pkgRoot` as `path.join(pkgModulesDir(depPath), pkgInfo.name)`, where
`pkgInfo.name` comes from `dp.parse` of the depPath key. `dp.parse` is a
raw substring and validates nothing, so a `../../../[email protected]` key
pointed the lifecycle-script runner and the post-build bin linking at a
directory outside the virtual store. The dep graph that phase walks comes
from `@pnpm/deps.graph-hasher`, which deliberately defers the name check
to its sink -- and this sink had none.

Route both joins through `safeJoinModulesDir`, so a crafted name fails
with ERR_PNPM_INVALID_DEPENDENCY_NAME before any script runs.

Reachability is narrower than the reported install path: the poisoned
lockfile has to already be in `node_modules`, which means a shipped or
restored `node_modules` rather than a committed `pnpm-lock.yaml`.

No pacquet change: its `rebuild` drives the frozen-install pipeline, which
runs `verify_lockfile_dependency_names` unconditionally over snapshot
package names, and it reads the project lockfile rather than a copy in
`node_modules`, so it has no equivalent unguarded sink.

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Claude Code, claude-opus-5).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • pnpm rebuild now rejects lockfiles containing package names with path traversal segments.
    • Prevents lifecycle scripts from running and binaries from being linked outside the virtual store.
    • Reports the ERR_PNPM_INVALID_DEPENDENCY_NAME error for invalid dependency names.
    • Added regression coverage to verify unsafe directories are not created.

zkochan added 2 commits August 3, 2026 01:24
…th name

GHSA-c59q-g84q-2gj5 reported that the isolated linker joined the
lockfile-derived package name onto the virtual store without validation.
That site, and the PnP `packageLocation`, were already contained by
51300fd; the one recommended site that commit missed is the rebuild
phase, which resolves its package root the same way.

`_rebuild` reads the current lockfile from `node_modules` and rebuilds
`pkgRoot` as `path.join(pkgModulesDir(depPath), pkgInfo.name)`, where
`pkgInfo.name` comes from `dp.parse` of the depPath key. `dp.parse` is a
raw substring and validates nothing, so a `../../../[email protected]` key
pointed the lifecycle-script runner and the post-build bin linking at a
directory outside the virtual store. The dep graph that phase walks comes
from `@pnpm/deps.graph-hasher`, which deliberately defers the name check
to its sink -- and this sink had none.

Route both joins through `safeJoinModulesDir`, so a crafted name fails
with ERR_PNPM_INVALID_DEPENDENCY_NAME before any script runs.

Reachability is narrower than the reported install path: the poisoned
lockfile has to already be in `node_modules`, which means a shipped or
restored `node_modules` rather than a committed `pnpm-lock.yaml`.

No pacquet change: its `rebuild` drives the frozen-install pipeline, which
runs `verify_lockfile_dependency_names` unconditionally over snapshot
package names, and it reads the project lockfile rather than a copy in
`node_modules`, so it has no equivalent unguarded sink.
Copilot AI review requested due to automatic review settings August 2, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a81bbba-9e1a-49f8-be25-6d3ed71d7e2f

📥 Commits

Reviewing files that changed from the base of the PR and between 27c0c0a and ff86e3f.

📒 Files selected for processing (1)
  • pnpm11/building/commands/test/build/index.ts

📝 Walkthrough

Walkthrough

pnpm rebuild now uses safe package-path construction for lifecycle and bin-linking operations. A regression test verifies that traversal paths produce ERR_PNPM_INVALID_DEPENDENCY_NAME without creating directories outside the virtual store. A changeset records patch releases.

Changes

Rebuild path safety

Layer / File(s) Summary
Safe package path construction
pnpm11/building/after-install/src/index.ts, pnpm11/building/after-install/package.json, pnpm11/building/after-install/tsconfig.json
Rebuild and bin relinking use safeJoinModulesDir. The package manifest and TypeScript references include its workspace dependency.
Traversal rejection regression
pnpm11/building/commands/test/build/index.ts, .changeset/rebuild-depath-name-traversal.md
The regression test checks the error and filesystem result for a traversal dependency path. The changeset records patch releases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: product: pnpm@11

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vuln-c59q

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix rebuild depPath traversal by validating lockfile-derived package roots

🐞 Bug fix 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Validate rebuild package roots via safeJoinModulesDir to prevent lockfile path traversal.
• Refuse poisoned node_modules lockfiles before running lifecycle scripts or linking bins.
• Add regression test and changeset documenting ERR_PNPM_INVALID_DEPENDENCY_NAME.
Diagram

graph TD
  A["pnpm rebuild"] --> B[("node_modules/.pnpm/lock.yaml")] --> C["depPath key"] --> D["dp.parse -> name"] --> E["safeJoinModulesDir"] --> F["pkgRoot/binPath"] --> G["run hooks + link bins"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Validate depPath/package names during dep-graph construction
  • ➕ Centralizes validation closer to the data source (deps.graph-hasher output).
  • ➕ Potentially protects any future sinks that forget to validate.
  • ➖ Larger behavioral surface area; could break consumers relying on current dep graph semantics.
  • ➖ Still prudent to keep sink-level checks where paths are materialized.
2. Use path.resolve/realpath containment checks instead of safeJoinModulesDir
  • ➕ Generic path containment guard that can be applied broadly.
  • ➖ More subtle across platforms and symlinks; may require filesystem access and careful normalization.
  • ➖ Harder to keep consistent with existing pnpm error codes and helpers.
3. Reject poisoned node_modules lockfile earlier (on read/parse)
  • ➕ Fails fast before building any graph or scheduling work.
  • ➖ Doesn’t replace the need for safe joins at sinks; other code paths might materialize paths later.

Recommendation: Keep the current approach: route the rebuild sinks through safeJoinModulesDir. It matches the prior containment strategy used in other sinks, produces the expected ERR_PNPM_INVALID_DEPENDENCY_NAME, and is narrowly scoped to where the untrusted name becomes a filesystem path. Consider upstream dep-graph validation as an additional defense-in-depth follow-up, but it’s a broader change.

Files changed (6) +55 / -2

Bug fix (1) +5 / -2
index.tsGuard rebuild pkgRoot and binPath against traversal package names +5/-2

Guard rebuild pkgRoot and binPath against traversal package names

• Replaces path.join(modules, pkgInfo.name, ...) with safeJoinModulesDir(modules, pkgInfo.name) for rebuild package roots and .bin linking. Adds inline commentary tying the change to GHSA-c59q-g84q-2gj5 and the unvalidated dp.parse-derived name.

pnpm11/building/after-install/src/index.ts

Tests (1) +37 / -0
index.tsAdd regression test for rebuild rejecting traversal depPath names +37/-0

Add regression test for rebuild rejecting traversal depPath names

• Adds an end-to-end test that poisons node_modules/.pnpm/lock.yaml by replacing the package name with ../../../escaped. Verifies rebuild throws ERR_PNPM_INVALID_DEPENDENCY_NAME and does not create files outside the virtual store.

pnpm11/building/commands/test/build/index.ts

Documentation (1) +6 / -0
rebuild-depath-name-traversal.mdAdd changeset for rebuild depPath traversal hardening +6/-0

Add changeset for rebuild depPath traversal hardening

• Introduces a patch changeset for @pnpm/building.after-install and pnpm. Documents that pnpm rebuild rejects traversal-style package names in node_modules lockfiles with ERR_PNPM_INVALID_DEPENDENCY_NAME.

.changeset/rebuild-depath-name-traversal.md

Other (3) +7 / -0
pnpm-lock.yamlAdd workspace dependency entry for fs.symlink-dependency +3/-0

Add workspace dependency entry for fs.symlink-dependency

• Updates the workspace lockfile to include @pnpm/fs.symlink-dependency. Ensures the workspace dependency graph reflects the new import used by building.after-install.

pnpm-lock.yaml

package.jsonDepend on @pnpm/fs.symlink-dependency for safeJoinModulesDir +1/-0

Depend on @pnpm/fs.symlink-dependency for safeJoinModulesDir

• Adds @pnpm/fs.symlink-dependency as a workspace dependency of the after-install rebuild package. This enables use of safeJoinModulesDir for validated path joins.

pnpm11/building/after-install/package.json

tsconfig.jsonWire tsconfig project reference to fs/symlink-dependency +3/-0

Wire tsconfig project reference to fs/symlink-dependency

• Adds a TS project reference to ../../fs/symlink-dependency so the new import resolves in the workspace build. Keeps TypeScript project references consistent with package.json dependencies.

pnpm11/building/after-install/tsconfig.json

@qodo-code-review

qodo-code-review Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Remediation recommended

1. Windows traversal untested 🐞 Bug ⛨ Security ⭐ New
Description
The new GHSA regression test only approves/targets a forward-slash traversal depPath
("../../../[email protected]"), so a Windows-only backslash traversal (e.g. "..\\..\\..\\[email protected]")
could regress without this suite catching it. Since depPath parsing is substring-based and does not
validate separators, adding a Windows-specific case is needed to prevent platform-specific
reintroductions of the same sink.
Code

pnpm11/building/commands/test/build/index.ts[R637-639]

+    // a bare `../../../escaped` is read as a depPath allow-build key and
+    // then never matches the depPath it came from.
+    allowBuilds: { '../../../[email protected]': true },
Relevance

●●● Strong

Repo previously added regression tests for both '/' and '\\' separator variants; Windows-specific
traversal coverage is valued.

PR-#12677
PR-#12380

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test currently hard-codes a forward-slash traversal key in allowBuilds, and the depPath parser
used throughout pnpm does not itself validate name contents (it returns raw substrings), so
separator variants are plausible inputs; adding Windows coverage prevents a platform-specific
regression from going unnoticed.

pnpm11/building/commands/test/build/index.ts[635-642]
pnpm11/deps/path/src/index.ts[182-195]
PR-#12677

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The new regression test for GHSA-c59q-g84q-2gj5 only exercises a `../../../...` traversal shape. On Windows, `\` is a path separator, so a depPath name containing `..\\..\\..\\escaped` is the relevant platform-specific payload; without a dedicated test, a Windows-only regression can slip through.

### Issue Context
This test is meant to ensure rebuild refuses traversal depPath names before lifecycle scripts/bins run outside the virtual store. It currently hard-codes only the POSIX-style traversal string.

### Fix Focus Areas
- pnpm11/building/commands/test/build/index.ts[608-642]

### Suggested change
- Parameterize the test over traversal payloads:
 - Always run the existing `../../../escaped` case.
 - Add a Windows-specific case (guarded by `if (process.platform === 'win32')`) that rewrites the lockfile to use `..\\..\\..\\escaped` and sets `allowBuilds` to `..\\..\\..\\[email protected]`.
- Keep the same assertion (`ERR_PNPM_INVALID_DEPENDENCY_NAME`) and marker non-existence check for the Windows case.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Wrong traversal assertion path ✓ Resolved 🐞 Bug ≡ Correctness
Description
The new regression test asserts that path.resolve('../../../escaped') does not exist, but the
pre-fix vulnerable join from pkgModulesDir(depPath) would escape to a path like
<project>/node_modules/escaped (outside the virtual store), not to a path three levels above the
project root. This makes the test’s filesystem assertion ineffective for catching a future
regression of the original traversal sink.
Code

pnpm11/building/commands/test/build/index.ts[R623-624]

+  expect(fs.existsSync(path.resolve('../../../escaped'))).toBeFalsy()
+})
Relevance

●●● Strong

Repo often accepts strengthening regression tests to assert the real invariant and avoid ineffective
path/CWD assumptions.

PR-#12762
PR-#13452

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test asserts on a path resolved relative to the test CWD, but the vulnerable sink being guarded
is a join from a virtual-store .../node_modules directory; ../../../escaped therefore normalizes
to a sibling under the project’s node_modules, not to ../../../escaped from the project root.

pnpm11/building/commands/test/build/index.ts[589-624]
pnpm11/building/after-install/src/index.ts[395-408]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The rebuild traversal regression test checks for the non-existence of `path.resolve('../../../escaped')`, but that path is not where the historical vulnerable join would land when escaping from `<virtualStoreDir>/<dep>/node_modules`. The effective escaped target would be under the project (typically `<project>/node_modules/escaped`), so the current assertion can pass even if a regression recreates the old behavior.

## Issue Context
In `_rebuild`, the package root is derived from `pkgModulesDir(depPath)` (which points under the virtual store) plus the lockfile-derived `pkgInfo.name`. With a crafted `pkgInfo.name = '../../../escaped'`, `path.join(<...>/node_modules, '../../../escaped')` normalizes to `<project>/node_modules/escaped`.

## Fix Focus Areas
- pnpm11/building/commands/test/build/index.ts[608-624]
- pnpm11/building/after-install/src/index.ts[395-408]

## Suggested change
Replace the final assertion with one that checks the actual normalized escape destination (e.g. `path.resolve('node_modules/escaped')`), or compute it from the same inputs as `_rebuild` (virtualStoreDir/modulesDir + crafted name) and assert that path is untouched.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Previous review results

Review updated until commit ff86e3f

Results up to commit 27c0c0a ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Wrong traversal assertion path ✓ Resolved 🐞 Bug ≡ Correctness
Description
The new regression test asserts that path.resolve('../../../escaped') does not exist, but the
pre-fix vulnerable join from pkgModulesDir(depPath) would escape to a path like
<project>/node_modules/escaped (outside the virtual store), not to a path three levels above the
project root. This makes the test’s filesystem assertion ineffective for catching a future
regression of the original traversal sink.
Code

pnpm11/building/commands/test/build/index.ts[R623-624]

+  expect(fs.existsSync(path.resolve('../../../escaped'))).toBeFalsy()
+})
Relevance

●●● Strong

Repo often accepts strengthening regression tests to assert the real invariant and avoid ineffective
path/CWD assumptions.

PR-#12762
PR-#13452

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test asserts on a path resolved relative to the test CWD, but the vulnerable sink being guarded
is a join from a virtual-store .../node_modules directory; ../../../escaped therefore normalizes
to a sibling under the project’s node_modules, not to ../../../escaped from the project root.

pnpm11/building/commands/test/build/index.ts[589-624]
pnpm11/building/after-install/src/index.ts[395-408]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The rebuild traversal regression test checks for the non-existence of `path.resolve('../../../escaped')`, but that path is not where the historical vulnerable join would land when escaping from `<virtualStoreDir>/<dep>/node_modules`. The effective escaped target would be under the project (typically `<project>/node_modules/escaped`), so the current assertion can pass even if a regression recreates the old behavior.

## Issue Context
In `_rebuild`, the package root is derived from `pkgModulesDir(depPath)` (which points under the virtual store) plus the lockfile-derived `pkgInfo.name`. With a crafted `pkgInfo.name = '../../../escaped'`, `path.join(<...>/node_modules, '../../../escaped')` normalizes to `<project>/node_modules/escaped`.

## Fix Focus Areas
- pnpm11/building/commands/test/build/index.ts[608-624]
- pnpm11/building/after-install/src/index.ts[395-408]

## Suggested change
Replace the final assertion with one that checks the actual normalized escape destination (e.g. `path.resolve('node_modules/escaped')`), or compute it from the same inputs as `_rebuild` (virtualStoreDir/modulesDir + crafted name) and assert that path is untouched.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/rebuild-depath-name-traversal.md:
- Line 6: Add a concise sentence to the changeset explaining that the pacquet
rebuild path already validates dependency names through the frozen-install
pipeline, so no pacquet change is required.

In `@pnpm11/building/commands/test/build/index.ts`:
- Around line 608-623: Update the final filesystem assertion in the rebuild test
around rebuild.handler to check the vulnerable join destination under the
project’s node_modules directory, specifically the resolved path for
node_modules/escaped, rather than path.resolve('../../../escaped') from the
project root. Preserve the existing ERR_PNPM_INVALID_DEPENDENCY_NAME rejection
assertion and verify that no outside directory is created.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c91b64b6-e18b-4e45-b232-fa3ae440e9ad

📥 Commits

Reviewing files that changed from the base of the PR and between 641ccd3 and 27c0c0a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (5)
  • .changeset/rebuild-depath-name-traversal.md
  • pnpm11/building/after-install/package.json
  • pnpm11/building/after-install/src/index.ts
  • pnpm11/building/after-install/tsconfig.json
  • pnpm11/building/commands/test/build/index.ts

@greptile-apps

greptile-apps Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "test(building): approve the escaped buil..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: ff86e3f9a3d7

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.496 ± 0.166 2.347 2.755 1.65 ± 0.21
pacquet@main 2.473 ± 0.146 2.351 2.780 1.64 ± 0.20
pnpr@HEAD 1.524 ± 0.108 1.395 1.744 1.01 ± 0.13
pnpr@main 1.509 ± 0.166 1.350 1.798 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4962731390000004,
      "stddev": 0.16558746303884403,
      "median": 2.4288841704,
      "user": 1.6411454799999998,
      "system": 1.3260083200000001,
      "min": 2.3469593414000003,
      "max": 2.7547645024,
      "times": [
        2.3550418534,
        2.4373510654,
        2.4622379514,
        2.3682987004,
        2.3469593414000003,
        2.4204172754,
        2.7547645024,
        2.3833582354,
        2.7348767314,
        2.6994257334
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.4730618972,
      "stddev": 0.14617996795274274,
      "median": 2.4128399894,
      "user": 1.6564532799999998,
      "system": 1.2848638199999995,
      "min": 2.3514898914,
      "max": 2.7797134194,
      "times": [
        2.7797134194,
        2.5677816104,
        2.3698715934,
        2.6529330604,
        2.3746286074,
        2.3822421554,
        2.3639712874,
        2.3514898914,
        2.4445495234,
        2.4434378234
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5240783710000003,
      "stddev": 0.10778020727423958,
      "median": 1.4963390234,
      "user": 1.18661278,
      "system": 1.1327866199999999,
      "min": 1.3945823654,
      "max": 1.7444269484000001,
      "times": [
        1.4686057224,
        1.4035671624000001,
        1.5118015584000002,
        1.4556276414,
        1.7444269484000001,
        1.3945823654,
        1.6086745304,
        1.5895842524,
        1.4808764884,
        1.5830370404
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5094600406,
      "stddev": 0.1657694099532189,
      "median": 1.4823795784000002,
      "user": 1.20392178,
      "system": 1.1463687199999997,
      "min": 1.3502856964,
      "max": 1.7981915404,
      "times": [
        1.4888619464000001,
        1.3580744974,
        1.7981915404,
        1.4758972104,
        1.5319574194,
        1.3751046874,
        1.6076843974,
        1.3518818504,
        1.3502856964,
        1.7566611604000002
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 256.8 ± 5.9 251.4 265.6 1.01 ± 0.03
pacquet@main 255.4 ± 6.4 245.8 265.5 1.00
pnpr@HEAD 271.0 ± 5.0 263.6 279.0 1.06 ± 0.03
pnpr@main 263.4 ± 6.0 255.8 278.2 1.03 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.25681311304000004,
      "stddev": 0.005914373661810641,
      "median": 0.25508277464,
      "user": 0.20679558,
      "system": 0.51424892,
      "min": 0.25138581764,
      "max": 0.26557709964,
      "times": [
        0.25579428764,
        0.25221503164,
        0.25155437164,
        0.25592084664,
        0.26414521664,
        0.26536345364,
        0.25138581764,
        0.26557709964,
        0.25437126164,
        0.25180374364
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25544693244,
      "stddev": 0.006410969905257915,
      "median": 0.25633751764,
      "user": 0.20499918,
      "system": 0.49690281999999997,
      "min": 0.24579441664000004,
      "max": 0.26546441364,
      "times": [
        0.26546441364,
        0.25795703364,
        0.25722843364,
        0.25544660164,
        0.25131595564,
        0.24931060664000002,
        0.24908514864000003,
        0.26158024564,
        0.26128646864,
        0.24579441664000004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27100116744,
      "stddev": 0.004988218199392307,
      "median": 0.26990636213999997,
      "user": 0.21578148000000003,
      "system": 0.50237342,
      "min": 0.26359252664,
      "max": 0.27896463764,
      "times": [
        0.27568180064,
        0.27029694664,
        0.26359252664,
        0.26951577764,
        0.26476303764,
        0.27488766264,
        0.26819619864,
        0.26914872264,
        0.27896463764,
        0.27496436364
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.26340340474,
      "stddev": 0.005951261449502883,
      "median": 0.26209462214,
      "user": 0.22188477999999998,
      "system": 0.50267452,
      "min": 0.25575759864000003,
      "max": 0.27817695164,
      "times": [
        0.26003996564,
        0.26264656764,
        0.26084283964,
        0.25575759864000003,
        0.27817695164,
        0.26510932464,
        0.26405567664,
        0.26154267664,
        0.26579091864,
        0.26007152764
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.583 ± 0.017 2.557 2.609 1.68 ± 0.13
pacquet@main 2.581 ± 0.022 2.559 2.638 1.68 ± 0.13
pnpr@HEAD 1.638 ± 0.104 1.495 1.781 1.07 ± 0.11
pnpr@main 1.536 ± 0.120 1.431 1.742 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5830449282,
      "stddev": 0.017284632687944394,
      "median": 2.5859946919,
      "user": 1.6492549999999997,
      "system": 1.31153048,
      "min": 2.5573388684,
      "max": 2.6086911524,
      "times": [
        2.5937768484,
        2.5719956614000004,
        2.5573388684,
        2.6014950714,
        2.5686147954000003,
        2.5936558304,
        2.5810828574,
        2.6086911524,
        2.5909065264,
        2.5628916704
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.5811038228000003,
      "stddev": 0.021936182511886324,
      "median": 2.5766205914,
      "user": 1.6043755000000002,
      "system": 1.3450163799999997,
      "min": 2.5587614124,
      "max": 2.6384869674,
      "times": [
        2.5760532374,
        2.5624473194,
        2.5771879454,
        2.5735173614,
        2.5859631074,
        2.5776314224,
        2.5587614124,
        2.5752087974,
        2.5857806574000004,
        2.6384869674
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6380432423999998,
      "stddev": 0.10382765346435335,
      "median": 1.6263999694,
      "user": 1.1816001999999999,
      "system": 1.1491570800000002,
      "min": 1.4948773914000002,
      "max": 1.7809426014,
      "times": [
        1.4948773914000002,
        1.5260540304,
        1.7809426014,
        1.6367748854000002,
        1.7376170184000002,
        1.7623638894,
        1.5529852734,
        1.7087359974000003,
        1.6160250534,
        1.5640562834000002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.535774532,
      "stddev": 0.12009041898287846,
      "median": 1.4785898709,
      "user": 1.1356614,
      "system": 1.20076168,
      "min": 1.4312389204000002,
      "max": 1.7418569514000002,
      "times": [
        1.7418569514000002,
        1.4312389204000002,
        1.5637890644,
        1.4398391094000003,
        1.6636212784000002,
        1.4549424514,
        1.5022372904,
        1.4408659114000002,
        1.6866724874,
        1.4326818554000003
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 388.4 ± 12.7 374.1 412.2 1.31 ± 0.05
pacquet@main 381.5 ± 16.4 363.9 415.9 1.29 ± 0.06
pnpr@HEAD 297.5 ± 6.7 288.8 306.9 1.00 ± 0.03
pnpr@main 296.7 ± 5.8 285.1 305.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.38837679222,
      "stddev": 0.012683794078245318,
      "median": 0.38542599501999997,
      "user": 0.49159869999999994,
      "system": 0.7191747399999999,
      "min": 0.37407498102000003,
      "max": 0.41221020702,
      "times": [
        0.37936060102,
        0.37522400202,
        0.41221020702,
        0.39793986502,
        0.38572003202,
        0.38567237802,
        0.40508671402,
        0.38517961202,
        0.38329953002,
        0.37407498102000003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.38151890132,
      "stddev": 0.016420373487077748,
      "median": 0.37926717802,
      "user": 0.5060107,
      "system": 0.67658064,
      "min": 0.36391421202,
      "max": 0.41589000102,
      "times": [
        0.38669023302,
        0.36609974902000003,
        0.37389316902,
        0.36391421202,
        0.38464118702,
        0.38632175502,
        0.39854277902,
        0.41589000102,
        0.36788482202,
        0.37131110602
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29753492272,
      "stddev": 0.006704847447417812,
      "median": 0.29730953502,
      "user": 0.1832922,
      "system": 0.5095783399999999,
      "min": 0.28878836102,
      "max": 0.30691634002,
      "times": [
        0.30217615602000003,
        0.28998067502,
        0.29168660102,
        0.29353077902,
        0.30087367902,
        0.30564002202,
        0.30201122302,
        0.30691634002,
        0.29374539102,
        0.28878836102
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29671159562,
      "stddev": 0.00575280880929654,
      "median": 0.29756640902,
      "user": 0.18611329999999998,
      "system": 0.50941024,
      "min": 0.28510380902,
      "max": 0.30507381502,
      "times": [
        0.30241728302,
        0.29259355702,
        0.29774078702,
        0.29808285202,
        0.30507381502,
        0.30092469302,
        0.29207183602000003,
        0.29739203102,
        0.28510380902,
        0.29571529302
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.731 ± 0.011 1.718 1.758 5.92 ± 0.17
pacquet@main 1.716 ± 0.008 1.705 1.732 5.87 ± 0.17
pnpr@HEAD 0.298 ± 0.008 0.290 0.314 1.02 ± 0.04
pnpr@main 0.293 ± 0.008 0.283 0.305 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7309928954,
      "stddev": 0.011339138873095338,
      "median": 1.7284880729999998,
      "user": 0.73907152,
      "system": 0.74194368,
      "min": 1.7176801035,
      "max": 1.7583478165,
      "times": [
        1.7386296695,
        1.7231691685,
        1.7294425855,
        1.7176801035,
        1.7583478165,
        1.7315991174999998,
        1.7233116015,
        1.7343985844999998,
        1.7258167464999998,
        1.7275335605
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.7162982985000004,
      "stddev": 0.008198193561057152,
      "median": 1.7161776325,
      "user": 0.69503372,
      "system": 0.77117128,
      "min": 1.7045738925,
      "max": 1.7324812765,
      "times": [
        1.7045738925,
        1.7173628765,
        1.7141446125,
        1.7184956335000001,
        1.7088083454999998,
        1.7246770715,
        1.7149923885,
        1.7189039155,
        1.7085429724999999,
        1.7324812765
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2979706616000001,
      "stddev": 0.00832805348094571,
      "median": 0.2954671765,
      "user": 0.17189581999999998,
      "system": 0.5295217799999999,
      "min": 0.2899242265,
      "max": 0.31419919150000003,
      "times": [
        0.2974813955,
        0.2917870125,
        0.29058365150000004,
        0.2954534905,
        0.2954808625,
        0.31419919150000003,
        0.30380699650000004,
        0.3089716745,
        0.2899242265,
        0.29201811450000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.2925983032,
      "stddev": 0.008423300979758986,
      "median": 0.29103474800000007,
      "user": 0.18696071999999997,
      "system": 0.5032682799999999,
      "min": 0.2828270385,
      "max": 0.3048178005,
      "times": [
        0.30135528450000004,
        0.30027467550000003,
        0.2828270385,
        0.28777302650000003,
        0.2839150805,
        0.2996064075,
        0.28788512450000003,
        0.3048178005,
        0.2833442225,
        0.29418437150000004
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 176.8 ± 4.6 171.4 186.8 1.96 ± 0.10
pacquet@main 179.7 ± 4.1 173.5 189.0 1.99 ± 0.09
pnpr@HEAD 90.5 ± 3.6 86.2 97.3 1.00 ± 0.06
pnpr@main 90.2 ± 3.7 85.3 100.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.17676649497999997,
      "stddev": 0.004604380348793756,
      "median": 0.17526332358,
      "user": 0.15953583333333338,
      "system": 0.08301881333333333,
      "min": 0.17142575658,
      "max": 0.18676134058,
      "times": [
        0.18676134058,
        0.17381755858,
        0.17158132358,
        0.18102011058,
        0.17218997158,
        0.17396310958,
        0.17313615758,
        0.17512387858,
        0.17142575658,
        0.17721149958,
        0.18282695058,
        0.17883394958,
        0.17643256358,
        0.18190993058,
        0.17526332358
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.179668354205,
      "stddev": 0.004091350498087182,
      "median": 0.17862350208,
      "user": 0.1505488875,
      "system": 0.091871705,
      "min": 0.17349420558,
      "max": 0.18903907758,
      "times": [
        0.17748966558,
        0.17824946258,
        0.17902825558,
        0.18388160558,
        0.17648432658,
        0.17899754158,
        0.17685849658,
        0.17724238358,
        0.17704257658,
        0.18180990458,
        0.18903907758,
        0.18168599958,
        0.17597096658,
        0.18106564258,
        0.17349420558,
        0.18635355658
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09054805364896554,
      "stddev": 0.0035573133253705654,
      "median": 0.09047066558000001,
      "user": 0.021982044827586204,
      "system": 0.011245697931034483,
      "min": 0.08615175158,
      "max": 0.09730822758,
      "times": [
        0.09468873858,
        0.09730822758,
        0.09349560558,
        0.09054432758,
        0.09623290258,
        0.09173283558,
        0.09326622658,
        0.09356593758000001,
        0.09339346358,
        0.09509517158000001,
        0.08952126558000001,
        0.08617623158000001,
        0.08987523958,
        0.08701208158000001,
        0.08847361258000001,
        0.09047066558000001,
        0.09693537358000001,
        0.08999060458000001,
        0.08615175158,
        0.08775050158,
        0.09166612558000001,
        0.08615592658,
        0.08617814458,
        0.08668408058,
        0.08733414058000001,
        0.08623350058000001,
        0.08702028858000001,
        0.09099619358000001,
        0.09194439058000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.09015728870499999,
      "stddev": 0.003710415224187257,
      "median": 0.08967472908,
      "user": 0.02069745,
      "system": 0.0123176375,
      "min": 0.08529676658,
      "max": 0.09996706958000001,
      "times": [
        0.08863836858,
        0.08717268958,
        0.08712942558,
        0.09600893358000001,
        0.09276722858000001,
        0.08904657958000001,
        0.09101389958,
        0.08634933758,
        0.09104252358,
        0.09163289658000001,
        0.09226251558000001,
        0.09459429058,
        0.09222280458000001,
        0.09157954758,
        0.08981817558,
        0.08649545558,
        0.09188879758,
        0.09996706958000001,
        0.08723192258000001,
        0.08969595258,
        0.08914953358000001,
        0.09845492358,
        0.09512307158000001,
        0.08625044758,
        0.08664567758000001,
        0.08965350558,
        0.08607738058,
        0.08751503558000001,
        0.08529676658,
        0.09085997558,
        0.08710732558,
        0.08634118058000001
      ]
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 657.3 ± 164.9 461.9 1016.9 1.00
pacquet@main 884.4 ± 153.0 737.2 1142.9 1.35 ± 0.41
pnpm@HEAD 2998.2 ± 105.9 2823.0 3128.9 4.56 ± 1.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.65732106396,
      "stddev": 0.16488572187713746,
      "median": 0.61394736796,
      "user": 0.5930242644444443,
      "system": 0.14870775777777778,
      "min": 0.46190354496,
      "max": 1.01690907596,
      "times": [
        1.01690907596,
        0.73244137696,
        0.61394736796,
        0.57381175896,
        0.46190354496,
        0.54357016496,
        0.61842727296,
        0.57682334296,
        0.7780556699600001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.8843794297377777,
      "stddev": 0.15299720834031358,
      "median": 0.8485361049600001,
      "user": 0.814988931111111,
      "system": 0.22962897999999995,
      "min": 0.73721882096,
      "max": 1.14291032796,
      "times": [
        0.8485361049600001,
        1.14291032796,
        0.8634104769600001,
        0.73721882096,
        0.8684472629600001,
        0.7594599829600001,
        0.77477575696,
        1.14042094596,
        0.8242351879600001
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 2.998205594293333,
      "stddev": 0.10588762777619642,
      "median": 3.0237559029599996,
      "user": 4.243853375555555,
      "system": 0.2827980911111111,
      "min": 2.82297177196,
      "max": 3.12890485896,
      "times": [
        2.82297177196,
        3.12890485896,
        3.04232156996,
        3.11355794296,
        2.93250668996,
        2.99775572896,
        2.86376587896,
        3.0237559029599996,
        3.05831000396
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.531 ± 0.117 4.432 4.814 1.28 ± 0.05
pacquet@main 4.588 ± 0.169 4.419 4.830 1.30 ± 0.06
pnpr@HEAD 3.535 ± 0.110 3.442 3.782 1.00
pnpr@main 3.563 ± 0.126 3.456 3.742 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.53112606964,
      "stddev": 0.11699183586097239,
      "median": 4.4880813887399995,
      "user": 1.7906354399999997,
      "system": 1.4001083399999996,
      "min": 4.43219581624,
      "max": 4.81357239724,
      "times": [
        4.43219581624,
        4.44433474124,
        4.5576239872399995,
        4.60089100824,
        4.45636647424,
        4.81357239724,
        4.58349787524,
        4.5139575792399995,
        4.4622051982399995,
        4.44661561924
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.5882751941399995,
      "stddev": 0.1692046771437198,
      "median": 4.534261842239999,
      "user": 1.7984938400000001,
      "system": 1.37871164,
      "min": 4.41878573224,
      "max": 4.83047169624,
      "times": [
        4.63931083624,
        4.45141954424,
        4.8164220662399995,
        4.83047169624,
        4.51825867024,
        4.79272536124,
        4.42133766424,
        4.41878573224,
        4.44375535624,
        4.55026501424
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5347271191400003,
      "stddev": 0.10975457678042821,
      "median": 3.49504695574,
      "user": 1.29371394,
      "system": 1.26012024,
      "min": 3.44173951324,
      "max": 3.78152235824,
      "times": [
        3.4625723972399998,
        3.50784089224,
        3.46835072324,
        3.4479572892399997,
        3.48225301924,
        3.54825766224,
        3.78152235824,
        3.53769775024,
        3.44173951324,
        3.66907958624
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5633492529399993,
      "stddev": 0.1257010477887788,
      "median": 3.5026718067399996,
      "user": 1.2932298399999997,
      "system": 1.2242224399999997,
      "min": 3.45613521924,
      "max": 3.74240614124,
      "times": [
        3.72489285824,
        3.74240614124,
        3.73957656224,
        3.45613521924,
        3.58888429224,
        3.48469890624,
        3.4617529552399997,
        3.52064470724,
        3.4566001802399997,
        3.45790070724
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13596
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,557.34 ms
(-0.87%)Baseline: 2,579.83 ms
3,095.79 ms
(82.61%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,717.68 ms
(-0.56%)Baseline: 1,727.29 ms
2,072.75 ms
(82.87%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
374.07 ms
(-4.21%)Baseline: 390.50 ms
468.60 ms
(79.83%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
171.43 ms
(-4.19%)Baseline: 178.92 ms
214.70 ms
(79.84%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,346.96 ms
(-0.92%)Baseline: 2,368.65 ms
2,842.38 ms
(82.57%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,432.20 ms
(-0.14%)Baseline: 4,438.37 ms
5,326.04 ms
(83.22%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
251.39 ms
(+1.93%)Baseline: 246.62 ms
295.95 ms
(84.94%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
461.90 ms
(-47.07%)Baseline: 872.63 ms
1,047.16 ms
(44.11%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13596
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,494.88 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
289.92 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
288.79 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
86.15 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,394.58 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,441.74 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
263.59 ms
🐰 View full continuous benchmarking report in Bencher

zkochan added 2 commits August 3, 2026 01:54
The final assertion checked `path.resolve('../../../escaped')` -- three
levels above the project, a path the vulnerable join never touches. The
join actually resolves out of `node_modules/.pnpm/<slot>/node_modules` to
`<project>/node_modules/escaped`, so the assertion could never fail.

Asserting on the corrected directory would be almost as weak: neither
path is created by the vulnerable code, because the escaped root has to
already exist for anything to happen there.

Plant a package at the real traversal target whose postinstall writes a
marker, and allow builds so the build policy is not what stops it. On the
unfixed code the script runs and the marker appears outside the virtual
store; with `safeJoinModulesDir` the rebuild rejects first and the marker
never appears -- the test now pins the security property rather than a
directory that was never going to exist.
…s key

`dangerouslyAllowAllBuilds` is not part of `RebuildCommandOpts`, so it
typechecked only under jest's transpile-only path and broke the pre-push
build.

Use `allowBuilds` instead. The key has to carry the version: a bare
`../../../escaped` has no parseable version, so `isDepPathAllowBuildKey`
classifies it as a depPath rule and it is then compared against the full
`../../../[email protected]` depPath, which never matches -- which is why the
first version of this test saw the build silently skipped rather than
escaping. `../../../[email protected]` parses into name + version, lands in
the package-spec rules, and matches.
Copilot AI review requested due to automatic review settings August 2, 2026 23:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 2, 2026
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit ff86e3f

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants