# CVE-2025-69262: pnpm command injection via environment variable substitution in tokenHelper

Source: https://junglewise.ai/threats/cve-2025-69262-pnpm-command-injection-via-environment-variable-substitution-in  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-01-07. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-69262 · Severity: high · CVSS 7.5 · Published 2026-01-07

pnpm is a popular package manager for JavaScript projects. The vulnerability allows remote code execution when environment variables are substituted into .npmrc configuration files with tokenHelper settings. An attacker who can control environment variables in build environments (CI/CD pipelines, Docker builds, Kubernetes) can execute arbitrary code during package installation, potentially compromising build artifacts and deployed applications.

Technologies: [pnpm (npm)](https://junglewise.ai/threats/technologies/pnpm). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2025-69262 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-69262 being exploited in the wild.

**How severe is CVE-2025-69262?** High severity, with a CVSS score of 7.5, published 7 January 2026.

**Which products and versions are affected?** pnpm (npm) SEMVER:introduced=6.25.0,fixed=10.27.0.

**Is there a fix for CVE-2025-69262?** Yes. pnpm (npm): upgrade to 10.27.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-69262 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2025-69262?** Check whether you run pnpm (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pnpm (npm): upgrade to 10.27.0 or later

  ```sh
  npm install pnpm@10.27.0
  ```


## Technical details

The vulnerability exists in pnpm's environment variable substitution mechanism within .npmrc configuration files combined with the tokenHelper functionality. The readLocalConfig() function processes .npmrc files and replaces ${VAR} placeholders with environment variable values without proper validation. The loadToken() function then executes the substituted path using spawnSync() with shell: true, allowing arbitrary command execution. An attacker who can set environment variables (common in CI/CD and containerized environments) and place a malicious script on the filesystem can achieve remote code execution. The affected versions are 6.25.0 through 10.26.x; the patch is available in version 10.27.0, which throws an error if tokenHelper settings contain environment variables.

## Affected products

- pnpm pnpm >=6.25.0, <10.27.0

## Identifiers

- CVE-2025-69262
- GHSA-2phv-j68v-wwqx

## Timeline

- 2026-01-07: disclosed
- 2026-01-07: patched: Fixed in pnpm 10.27.0; patch removes shell: true from loadToken and validates substituted paths

## References

- [https://github.com/pnpm/pnpm/security/advisories/GHSA-2phv-j68v-wwqx](https://github.com/pnpm/pnpm/security/advisories/GHSA-2phv-j68v-wwqx)
- [https://github.com/pnpm/pnpm](https://github.com/pnpm/pnpm)
- [https://github.com/pnpm/pnpm/releases/tag/v10.27.0](https://github.com/pnpm/pnpm/releases/tag/v10.27.0)

## Related threats

- [pnpm environment secret exfiltration via proxy settings in workspace manifest](https://junglewise.ai/threats/pnpm-environment-secret-exfiltration-via-proxy-settings-in-workspace-f6626cca)
- [pnpm pacquet path traversal in lockfile dependency symlinks](https://junglewise.ai/threats/pnpm-pacquet-path-traversal-in-lockfile-dependency-symlinks-dc3f81d1)
- [pnpm tarball dependency manifest name path traversal arbitrary file write](https://junglewise.ai/threats/cve-2026-82393-pnpm-tarball-dependency-manifest-name-path-traversal-arbitrary)
- [pnpm virtual store linker path traversal via unvalidated depPath](https://junglewise.ai/threats/cve-2026-82392-pnpm-virtual-store-linker-path-traversal-via-unvalidated-deppath)
- [pnpm path traversal via crafted lockfile alias](https://junglewise.ai/threats/cve-2026-59196-pnpm-path-traversal-via-crafted-lockfile-alias)
