CVE-2026-24056: pnpm has symlink traversal in file:/git dependencies

Published Jan 26, 2026
·
Updated

Summary When pnpm installs a file: (directory) or git: dependency, it follows symlinks and reads their target contents without constraining them to the package root. A malicious package containing a symlink to an absolute path (e.g., /etc/passwd, ~/.ssh/idrsa) causes pnpm to copy that file's contents into nodemodules, leaking local data.

Preconditions: Only affects file: and git: dependencies. Registry packages (npm) have symlinks stripped during publish and are NOT affected.

Details The vulnerability exists in store/cafs/src/addFilesFromDir.ts. The code uses fs.statSync() and readFileSync() which follow symlinks by default:

typescript const absolutePath = path.join(dirname, relativePath) const stat = fs.statSync(absolutePath) // Follows symlinks! const buffer = fs.readFileSync(absolutePath) // Reads symlink TARGET

There is no check that absolutePath resolves to a location inside the package directory.

PoC bash Create malicious package mkdir -p /tmp/evil && cd /tmp/evil ln -s /etc/passwd leaked-passwd.txt echo '{"name":"evil","version":"1.0.0","files":[".txt"]}' > package.json

Victim installs mkdir /tmp/victim && cd /tmp/victim pnpm init && pnpm add file:../evil

Leaked! cat nodemodules/evil/leaked-passwd.txt

Impact - Developers installing local/file dependencies - CI/CD pipelines installing git dependencies - Credential theft via symlinks to ~/.aws/credentials, ~/.npmrc, ~/.ssh/idrsa

Suggested Fix Use lstatSync to detect symlinks and reject those pointing outside the package root in store/cafs/src/addFilesFromDir.ts.

Other sources

pnpm is a package manager. Prior to version 10.28.2, when pnpm installs a file: (directory) or git: dependency, it follows symlinks and reads their target contents without constraining them to the package root. A malicious package containing a symlink to an absolute path (e.g., /etc/passwd, ~/.ssh/idrsa) causes pnpm to copy that file's contents into nodemodules, leaking local data. The vulnerability only affects file: and git: dependencies. Registry packages (npm) have symlinks stripped during publish and are NOT affected. The issue impacts developers installing local/file dependencies andCI/CD pipelines installing git dependencies. It can lead to credential theft via symlinks to ~/.aws/credentials, ~/.npmrc, ~/.ssh/idrsa. Version 10.28.2 contains a patch.

MITRE

Affected Software

2 affected componentsFixes available
npm/pnpm<10.28.2
10.28.2
PNPM Pnpm Node.js<10.28.2

Event History

Jan 26, 2026
Advisory Published
via GitHub·09:02 PM
Data Sourced
via GitHub·09:02 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·09:59 PM
Data Sourced
via MITRE·09:59 PM
DescriptionWeakness
Data Sourced
via NVD·10:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 27, 58104
Event
via FIRST·01:10 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-24056?

CVE-2026-24056 is categorized as a medium severity vulnerability due to potential symlink traversal allowed by pnpm.

2

How do I fix CVE-2026-24056?

To remediate CVE-2026-24056, upgrade pnpm to version 10.28.2 or later.

3

What software is affected by CVE-2026-24056?

CVE-2026-24056 affects pnpm versions prior to 10.28.2.

4

What type of vulnerability is CVE-2026-24056?

CVE-2026-24056 is a symlink traversal vulnerability in the pnpm package management tool.

5

Can CVE-2026-24056 impact my application?

Yes, CVE-2026-24056 can allow a malicious package to access restricted files on your system.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203