GHSA-2rx9-3g3h-c2jv: pnpm Pacquet Trust-lockfile Install Can Create Vulnerability

HIGH
CVSS 7.1
CWE-59 CWE-73 CWE-22
Published
Advisory Summary

GHSA-2rx9-3g3h-c2jv is a HIGH (CVSS 7.1) pacquet trust-lockfile install can create vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting pnpm libraries in the npm ecosystem. The issue involves pacquet trust-lockfile install can create dependency symlinks outside the project. Remediation is available by upgrading affected packages to version 12.0.0-alpha.5.

GHSA-2rx9-3g3h-c2jv at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-2rx9-3g3h-c2jv
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product pnpm
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability Low (A:L)

How to Fix GHSA-2rx9-3g3h-c2jv

To remediate this vulnerability, upgrade all affected pnpm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pnpm fixed: 12.0.0-alpha.5
npm install pnpm@12.0.0-alpha.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls pnpm

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-2rx9-3g3h-c2jv, inspect your project dependencies using npm:

npm ls pnpm

Analyze the terminal output to locate any version of pnpm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 12.0.0-alpha.5), your application is affected.

Note: The npm ls pnpm command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In pnpm, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary A crafted lockfile alias could reach several install-time filesystem joins. With `--trust-lockfile` or a frozen lockfile, traversal segments could create links outside the intended project or `node_modules` boundary. This patch validates dependency names and every virtual-store slot before creating directories, links, bins, or hoisted entries. ## Security boundary - A shared safe-join helper rejects traversal, absolute, platform-specific, and reserved dependency names before filesystem materialization. - Direct and transitive dependency links, package links, bin destinations, and public/private hoist destinations use the same containment rule. - Global virtual-store slots validate the complete slot path, including version-derived components, before directory creation. - Snapshot slots and package names are checked before store initialization and before the current-lockfile fast path, closing the warm-install bypass. - Rejections preserve `ERR_PNPM_INVALID_DEPENDENCY_NAME`. ## Exploit replay Before the patch, `pacquet install --frozen-lockfile --trust-lockfile` accepted a `../../escaped-link` dependency key and created a symlink outside the project. With this patch, the same lockfile is rejected before materialization and no outside link is created. ## Files changed - `pacquet/crates/package-manager/src/safe_join_modules_dir.rs` defines the shared containment rule. - Install, symlink, bin, hoist, virtual-store, and frozen-lockfile paths call that helper before filesystem materialization. - The corresponding `tests.rs` files cover every sink, including warm installs and global virtual-store slots. ## Commands run ```text $ cargo test --locked -p pacquet-package-manager --lib PASS: 434 tests $ cargo clippy --locked -p pacquet-package-manager --all-targets -- --deny warnings PASS $ cargo fmt --all -- --check PASS ``` ## Validation - Full pacquet package-manager suite: 434 passed. - Focused regressions cover direct and transitive aliases, bins, hoists, package names, global virtual-store version traversal, and a poisoned prior-install slot. - `cargo clippy -p pacquet-package-manager --all-targets -- -D warnings`: passed. - `cargo fmt --all -- --check` and `git diff --check`: passed. ## Compatibility Valid unscoped and scoped dependency aliases continue to work. The reproduced escape was specific to pacquet, so this branch does not change the TypeScript CLI or the lockfile format. --- Written by an agent (Codex, GPT-5).

GHSA-2rx9-3g3h-c2jv Affected pnpm Versions

1 component(s)
Fixed Versions:
12.0.0-alpha.5
Product / Package Ecosystem Affected Versions Fixed Version
pnpm
npm
≥ 12.0.0-alpha.0
< 12.0.0-alpha.5
12.0.0-alpha.5

References

Frequently Asked Questions

What is GHSA-2rx9-3g3h-c2jv?
GHSA-2rx9-3g3h-c2jv is a security vulnerability in pnpm involving pacquet trust-lockfile install can create dependency symlinks outside the project under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which pnpm versions are affected?
Affected versions include releases prior to 12.0.0-alpha.5 across affected packages: pnpm.
What version fixes GHSA-2rx9-3g3h-c2jv?
Upgrading to 12.0.0-alpha.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pnpm affected?
Yes, pnpm is affected in releases prior to 12.0.0-alpha.5. Upgrade your dependency to 12.0.0-alpha.5 or later.
What is the CVSS score of GHSA-2rx9-3g3h-c2jv?
GHSA-2rx9-3g3h-c2jv has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L.
What CWE is associated with GHSA-2rx9-3g3h-c2jv?
GHSA-2rx9-3g3h-c2jv is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.).
How can I check npm dependencies for GHSA-2rx9-3g3h-c2jv?
Run the dependency tree command: 'npm ls pnpm'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2rx9-3g3h-c2jv",
  "modified" : "2026-09-01T18:59:22Z",
  "published" : "2026-09-01T18:59:22Z",
  "aliases" : [ ],
  "summary" : "pnpm: pacquet trust-lockfile install can create dependency symlinks outside the project",
  "details" : "## Summary\n\nA crafted lockfile alias could reach several install-time filesystem joins. With `--trust-lockfile` or a frozen lockfile, traversal segments could create links outside the intended project or `node_modules` boundary. This patch validates dependency names and every virtual-store slot before creating directories, links, bins, or hoisted entries.\n\n## Security boundary\n\n- A shared safe-join helper rejects traversal, absolute, platform-specific, and reserved dependency names before filesystem materialization.\n- Direct and transitive dependency links, package links, bin destinations, and public/private hoist destinations use the same containment rule.\n- Global virtual-store slots validate the complete slot path, including version-derived components, before directory creation.\n- Snapshot slots and package names are checked before store initialization and before the current-lockfile fast path, closing the warm-install bypass.\n- Rejections preserve `ERR_PNPM_INVALID_DEPENDENCY_NAME`.\n\n## Exploit replay\n\nBefore the patch, `pacquet install --frozen-lockfile --trust-lockfile` accepted a `../../escaped-link` dependency key and created a symlink outside the project. With this patch, the same lockfile is rejected before materialization and no outside link is created.\n\n## Files changed\n\n- `pacquet/crates/package-manager/src/safe_join_modules_dir.rs` defines the shared containment rule.\n- Install, symlink, bin, hoist, virtual-store, and frozen-lockfile paths call that helper before filesystem materialization.\n- The corresponding `tests.rs` files cover every sink, including warm installs and global virtual-store slots.\n\n## Commands run\n\n```text\n$ cargo test --locked -p pacquet-package-manager --lib\nPASS: 434 tests\n$ cargo clippy --locked -p pacquet-package-manager --all-targets -- --deny warnings\nPASS\n$ cargo fmt --all -- --check\nPASS\n```\n\n## Validation\n\n- Full pacquet package-manager suite: 434 passed.\n- Focused regressions cover direct and transitive aliases, bins, hoists, package names, global virtual-store version traversal, and a poisoned prior-install slot.\n- `cargo clippy -p pacquet-package-manager --all-targets -- -D warnings`: passed.\n- `cargo fmt --all -- --check` and `git diff --check`: passed.\n\n## Compatibility\n\nValid unscoped and scoped dependency aliases continue to work. The reproduced escape was specific to pacquet, so this branch does not change the TypeScript CLI or the lockfile format.\n\n---\nWritten by an agent (Codex, GPT-5).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "pnpm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "12.0.0-alpha.0"
      }, {
        "fixed" : "12.0.0-alpha.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pnpm/pnpm/security/advisories/GHSA-2rx9-3g3h-c2jv"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pnpm/pnpm/pull/12872"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pnpm/pnpm/commit/51300fd41c5e4c8f47635108e373cc3d1f324fa7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pnpm/pnpm"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-59", "CWE-73" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-01T18:59:22Z",
    "nvd_published_at" : null
  }
}