GHSA-2RX9-3G3H-C2JV
Vulnerability from github – Published: 2026-09-01 18:59 – Updated: 2026-09-01 18:59Summary
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.rsdefines the shared containment rule.- Install, symlink, bin, hoist, virtual-store, and frozen-lockfile paths call that helper before filesystem materialization.
- The corresponding
tests.rsfiles cover every sink, including warm installs and global virtual-store slots.
Commands run
$ 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 -- --checkandgit 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).
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "pnpm"
},
"ranges": [
{
"events": [
{
"introduced": "12.0.0-alpha.0"
},
{
"fixed": "12.0.0-alpha.5"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-59",
"CWE-73"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-01T18:59:22Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"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).",
"id": "GHSA-2rx9-3g3h-c2jv",
"modified": "2026-09-01T18:59:22Z",
"published": "2026-09-01T18:59:22Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L",
"type": "CVSS_V3"
}
],
"summary": "pnpm: pacquet trust-lockfile install can create dependency symlinks outside the project"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.