pnpm
Affected
- introduced
12.0.0-alpha.0, fixed12.0.0-alpha.5(semver)
Fixed versions
12.0.0-alpha.5
Fix
- Fixed version
12.0.0-alpha.5npm install [email protected]
Advisory
Also known as: None
pnpm: pacquet trust-lockfile install can create dependency symlinks outside the project
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
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.tests.rs files 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
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).
High Basis: The source's own band: HIGH
12.0.0-alpha.0, fixed 12.0.0-alpha.5 (semver)12.0.0-alpha.5
12.0.0-alpha.5npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0