{"id":"CVE-2026-24056","aliases":["CVE-2026-24056","GHSA-m733-5w8f-5ggw"],"related":[],"kind":"vulnerability","state":"published","title":"pnpm has symlink traversal in file:/git dependencies","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nWhen 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.\n\n**Preconditions:** Only affects `file:` and `git:` dependencies. Registry packages (npm) have symlinks stripped during publish and are NOT affected.\n\n### Details\nThe vulnerability exists in `store/cafs/src/addFilesFromDir.ts`. The code uses `fs.statSync()` and `readFileSync()` which follow symlinks by default:\n\n```typescript\nconst absolutePath = path.join(dirname, relativePath)\nconst stat = fs.statSync(absolutePath)  // Follows symlinks!\nconst buffer = fs.readFileSync(absolutePath)  // Reads symlink TARGET\n```\n\nThere is no check that `absolutePath` resolves to a location inside the package directory.\n\n### PoC\n```bash\n# Create malicious package\nmkdir -p /tmp/evil && cd /tmp/evil\nln -s /etc/passwd leaked-passwd.txt\necho '{\"name\":\"evil\",\"version\":\"1.0.0\",\"files\":[\"*.txt\"]}' > package.json\n\n# Victim installs\nmkdir /tmp/victim && cd /tmp/victim\npnpm init && pnpm add file:../evil\n\n# Leaked!\ncat node_modules/evil/leaked-passwd.txt\n```\n\n### Impact\n- Developers installing local/file dependencies\n- CI/CD pipelines installing git dependencies\n- Credential theft via symlinks to `~/.aws/credentials`, `~/.npmrc`, `~/.ssh/id_rsa`\n\n### Suggested Fix\nUse `lstatSync` to detect symlinks and reject those pointing outside the package root in `store/cafs/src/addFilesFromDir.ts`.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-01-26T21:02:33.000Z","modified":"2026-06-17T10:22:32.080Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.7,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.7,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-22","CWE-59"],"affected":[{"ranges":[{"version":"< 10.28.2","status":"affected"}],"vendor":"pnpm","product":"pnpm","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"10.28.2"}],"ecosystem":"npm","package":"pnpm","purl":"pkg:npm/pnpm","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"10.28.2"}],"vendor":"pnpm","product":"pnpm","cpe":"cpe:2.3:a:pnpm:pnpm:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/pnpm/pnpm/security/advisories/GHSA-m733-5w8f-5ggw","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/pnpm/pnpm/commit/b277b45bc35ae77ca72d7634d144bbd58a48b70f","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/pnpm/pnpm/releases/tag/v10.28.2","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24056","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pnpm/pnpm","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-01-27T21:39:16.955Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-24056","url":"https://www.cve.org/CVERecord?id=CVE-2026-24056","licence":"CVE Terms of Use","modified":"2026-01-27T21:39:25.061Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m733-5w8f-5ggw","url":"https://github.com/advisories/GHSA-m733-5w8f-5ggw","licence":"CC-BY-4.0","modified":"2026-02-03T03:06:25.152Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-24056","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24056","licence":"Public domain","modified":"2026-06-17T10:22:32.080Z"}],"updatedAt":"2026-11-25T22:59:13.198Z","epss":{"score":0.00527,"percentile":0.46108,"date":"2026-12-01T12:00:22.000Z"}}