CVE-2026-55698 — Vulnerability in pnpm — CVE Details
pnpm: Project env lockfile can short-circuit package-manager resolution and execute lockfile-selected pnpm bytes
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.30%). Schedule for your next planned update.
Does your project use an affected pnpm version?
Paste your package-lock.json to check it for CVE-2026-55698 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Maintainer Action Plan
This report is ready to review with the shared patch branch. Start with the PR and the expected fixed behavior, then use the detailed exploit narrative below only if you want to replay the original path.
- Advisory:
CAND-PNPM-063/GHSA-w466-c33r-3gjp - Advisory URL: https://github.com/pnpm/pnpm/security/advisories/GHSA-w466-c33r-3gjp
- Shared patch PR: https://github.com/pnpm/pnpm-ghsa-j2hc-m6cf-6jm8/pull/1
- Shared patch branch:
security/ghsa-batch-2026-06-09 - Patch commit:
a93449314f398cf4bdf2e28d033c02d37395ad22 - Base commit:
origin/main55a4035abf1ae3fe7208ba1f5ef43c5eff58ccec - Maintainer priority:
start-here - Component:
pnpm packageManager env lockfile - Patch area: package-manager env lockfile is re-resolved through trusted registries before execution
- Affected packages:
npm:pnpm,npm:@pnpm/installing.env-installer - CWE IDs:
CWE-829,CWE-494,CWE-345 - Conservative CVSS:
8.8/CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Next action: review the shared patch branch for this component, set the final affected version range, merge and release the fix, then publish or close the advisory.
Expected Patched Behavior
Committed env-lockfile package-manager entries are force-refreshed through trusted registries before execution; attacker tarball requests and markers stay at zero.
Files And Tests To Review
installing/env-installer/src/resolvePackageManagerIntegrities.tspnpm/src/switchCliVersion.tspnpm/src/switchCliVersion.test.ts.changeset/clean-package-manager-registries.md
Focused Validation
Run these from a checkout of the shared patch branch. They are the useful maintainer commands with machine-local artifact paths removed.
./node_modules/.bin/tsgo --build installing/env-installer/tsconfig.json
./node_modules/.bin/tsgo --build pnpm/tsconfig.json
PNPM_REGISTRY_MOCK_PORT=7799 NODE_OPTIONS="--experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169" ../node_modules/.bin/jest src/switchCliVersion.test.ts -t "re-resolved package-manager lockfile" --runInBand
PNPM_REGISTRY_MOCK_PORT=7799 NODE_OPTIONS="--experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169" ../node_modules/.bin/jest src/switchCliVersion.test.ts src/syncEnvLockfile.test.ts --runInBand
./node_modules/.bin/eslint installing/env-installer/src/resolvePackageManagerIntegrities.ts pnpm/src/switchCliVersion.ts pnpm/src/switchCliVersion.test.ts
git diff --check
The full patched replay for the shared branch passed with all 20 candidates marked fixed. This candidate's replay evidence is results/CAND-PNPM-063-patched-result.json.
Summary
pnpm can persist package-manager bootstrap metadata in the first YAML document of pnpm-lock.yaml. Before the patch, direct pnpm execution trusted an already resolved packageManagerDependencies entry when the committed env lockfile contained matching pnpm and @pnpm/exe versions. A malicious repository could therefore commit package-manager lockfile package records and snapshots that bypassed fresh package-manager resolution, then cause pnpm to install and execute bytes selected by that committed lockfile state during automatic version switching.
Details
The vulnerable source-to-sink path was:
lockfile/fs/src/envLockfile.tsreads the repository's first YAML lockfile document and validates shape only.pnpm/src/main.tsreachesswitchCliVersion()when a direct pnpm invocation sees a wantedpnpmpackage manager withonFail=download.pnpm/src/switchCliVersion.tsreads the committed env lockfile when package-manager metadata should be persisted.installing/env-installer/src/resolvePackageManagerIntegrities.tstreatedpackageManagerDependenciesas resolved when only thepnpmand@pnpm/exeversions matched.engine/pm/commands/src/self-updater/installPnpm.tsconverts env-lockfilesnapshotsandpackagesinto the wanted lockfile used byheadlessInstall().pnpm/src/switchCliVersion.tsexecutes the installedpnpmbinary withspawn.sync().
The helper fast path is intentionally still version-based for non-execution callers, so the security boundary is enforced at the execution path: switchCliVersion() now re-resolves already present package-manager env-lockfile entries before they can reach installPnpmToStore() and spawn.sync().
PoC
Standalone PoC and verification script:
The PoC constructs a committed env-lockfile object with matching package-manager dependency versions and attacker-selected package metadata:
{
"importers": {
".": {
"configDependencies": {},
"packageManagerDependencies": {
"@pnpm/exe": { "specifier": "9.3.0", "version": "9.3.0" },
"pnpm": { "specifier": "9.3.0", "version": "9.3.0" }
}
}
},
"lockfileVersion": "9.0",
"packages": {
"/pnpm@9.3.0": {
"resolution": {
"integrity": "sha512-poisoned"
}
}
},
"snapshots": {
"/pnpm@9.3.0": {}
}
}
Pre-patch exploit model:
- The victim runs pnpm directly in a malicious repository.
- The requested package-manager version differs from the currently running pnpm.
- pnpm enters
switchCliVersion()and reads the committed env lockfile. - Matching
pnpm/@pnpm/exeversions short-circuit package-manager resolution. - pnpm installs from the committed env-lockfile package records and executes the resulting
pnpmbinary.
Observed primitive proof from the PoC:
{
"primitive": "unforced resolver reuses already-resolved env lockfile metadata",
"isResolvedByVersionOnly": true,
"reusedPoisonedIntegrity": true
}
The same script then runs the patched switchCliVersion regression. The regression seeds a poisoned committed env lockfile, has the resolver return a trusted replacement lockfile, and asserts installPnpmToStore() receives the trusted lockfile rather than the committed one. This would fail on the vulnerable control flow because the resolver was not called and the committed lockfile reached the installer.
Focused validation commands:
./node_modules/.bin/tsgo --build installing/env-installer/tsconfig.json
./node_modules/.bin/tsgo --build pnpm/tsconfig.json
PNPM_REGISTRY_MOCK_PORT=7799 NODE_OPTIONS="--experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169" ../node_modules/.bin/jest src/switchCliVersion.test.ts -t "re-resolved package-manager lockfile" --runInBand
PNPM_REGISTRY_MOCK_PORT=7799 NODE_OPTIONS="--experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169" ../node_modules/.bin/jest src/switchCliVersion.test.ts src/syncEnvLockfile.test.ts --runInBand
./node_modules/.bin/eslint installing/env-installer/src/resolvePackageManagerIntegrities.ts pnpm/src/switchCliVersion.ts pnpm/src/switchCliVersion.test.ts
git diff --check
Validation result:
- The PoC confirmed the unforced resolver still reuses a version-matching env lockfile, proving the original primitive.
- Patched
switchCliVersion()callsresolvePackageManagerIntegrities()withforce: truewhen committed env-lockfile package-manager entries already satisfy the requested version. - Patched
switchCliVersion()assigns the resolver return value back toenvLockfile. - The installer receives the refreshed lockfile and not the poisoned committed lockfile.
- TypeScript builds passed for
@pnpm/installing.env-installerandpnpm. - The focused Jest regression passed: 1 passed, 1 skipped in
switchCliVersion.test.ts. - ESLint passed for the affected package-manager switch files.
git diff --checkpassed.
Impact
A malicious repository can cause arbitrary package-manager code execution in the victim's developer or CI environment before normal command handling continues. That code executes with the victim user's privileges and can read local secrets, alter project files, mutate dependency state, or run further commands.
Affected products
Ecosystem: npm
Package name: pnpm, @pnpm/installing.env-installer
Affected versions: current main before this patch; direct pnpm execution with package-manager auto-switching and a repository-controlled env lockfile.
Patched versions: pending release containing this patch.
Severity
Severity: High
Vector string: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Base score: 8.8
Rationale: the malicious source is repository-controlled package-manager lockfile state delivered through normal supply-chain channels. Exploitation is low complexity once the victim runs pnpm directly, no attacker privileges are required, and user interaction is required. Successful exploitation executes attacker-selected package-manager code in the victim user's security context, with high confidentiality, integrity, and availability impact.
Weaknesses
CWE-829: Inclusion of Functionality from Untrusted Control Sphere
CWE-494: Download of Code Without Integrity Check
CWE-345: Insufficient Verification of Data Authenticity
Patch
The patch makes automatic package-manager switching re-resolve repository-provided bootstrap metadata before install and execution:
resolvePackageManagerIntegrities()acceptsforce, which bypasses the version-only fast path.switchCliVersion()creates a store controller even when the committed env lockfile already contains satisfying package-manager dependency versions.switchCliVersion()callsresolvePackageManagerIntegrities()withforce: truefor already resolved package-manager entries.switchCliVersion()assigns the returned env lockfile back toenvLockfile, soinstallPnpmToStore()installs from freshly resolved metadata.- The package-manager bootstrap registry hardening from CAND-PNPM-061 is reused, so the refresh happens through trusted package-manager registries rather than repository workspace registries.
Changed files:
installing/env-installer/src/resolvePackageManagerIntegrities.tspnpm/src/switchCliVersion.tspnpm/src/switchCliVersion.test.ts
Changeset:
.changeset/clean-package-manager-registries.md
Pacquet parity:
No pacquet-side patch is required for this finding because pacquet does not implement pnpm's package-manager auto-switch path or installPnpmToStore().
CVSS Reassessment
Initial CVSS remains correct for vulnerable versions: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H / 8.8 High.
Final CVSS after patch: not vulnerable after patch / 0.0. The PoC still demonstrates the underlying unforced env-lockfile reuse primitive, but the patched execution path force-refreshes package-manager metadata through trusted bootstrap registries before install or execution.
Remaining Risk
The helper resolvePackageManagerIntegrities() still has an unforced fast path that treats matching pnpm and @pnpm/exe versions as resolved. Current execution-sensitive callers either use trusted roots/registries or pass through the patched switchCliVersion() boundary, but future execution paths should use force: true before installing or executing package-manager bytes from repository-provided env-lockfile metadata.
Advisory Timeline
- First published June 26, 2026 (153 days ago).
- Last revised June 26, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
npm install pnpm@10.34.2
npm install pnpm@11.5.3
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: npm (1).
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-345Insufficient Verification of Data AuthenticityMITRE
- CWE-494
- CWE-829
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
References
Frequently Asked Questions
- What is CVE-2026-55698?
- pnpm: Project env lockfile can short-circuit package-manager resolution and execute lockfile-selected pnpm bytes. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
- How do I check if my project is affected by CVE-2026-55698?
- CVE-2026-55698 affects pnpm. It has a 0.3% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-55698 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 14.7% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2025-69264HIGH
pnpm v10+ Bypass "Dependency lifecycle scripts execution disabled by default"
- CVE-2026-83816HIGH
CodeWhale: exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags enabling silent RCE
- CVE-2026-83817HIGH
CodeWhale: Automation auto_approve defaults to true, bypassing the task-path hardening fix for silent recurring agent execution
- CVE-2026-50016HIGH
pnpm: Transitive dependency alias path traversal allows project path override via symlink replacement