CVE-2025-69262 Overview
CVE-2025-69262 is a command injection vulnerability in pnpm, a widely used Node.js package manager. The flaw affects versions 6.25.0 through 10.26.2 and stems from unsafe environment variable substitution within .npmrc configuration files that define tokenHelper settings. An attacker who controls environment variables during pnpm operations can inject shell commands and achieve remote code execution in build environments. The vulnerability is tracked under CWE-78 (OS Command Injection) and is fixed in version 10.27.0.
Critical Impact
Attackers with control over environment variables can execute arbitrary commands on build agents, CI/CD runners, and developer workstations that invoke pnpm with a tokenHelper configured through variable substitution.
Affected Products
- pnpm versions 6.25.0 through 10.26.2 (Node.js package manager)
- CI/CD build environments and developer workstations executing affected pnpm versions
- Projects using .npmrc files with tokenHelper and environment variable substitution
Discovery Timeline
- 2026-01-07 - CVE-2025-69262 published to NVD
- 2026-06-22 - Last updated in NVD database
Technical Details for CVE-2025-69262
Vulnerability Analysis
The pnpm package manager supports a tokenHelper directive in .npmrc files, which specifies an external command that returns an authentication token for registry operations. Affected versions expand environment variable references inside the tokenHelper value before executing it, without sanitizing shell metacharacters. When an attacker controls one of the referenced environment variables, they can inject additional shell commands that execute in the context of the pnpm process.
This behavior turns a configuration convenience into a code execution primitive. Automated build systems that source environment variables from pull requests, workflow inputs, or third-party sources are the most exposed surface, since untrusted contributors can shape variable content ingested by trusted pnpm runs.
Root Cause
The root cause is improper neutralization of special elements in the string passed to a command interpreter, classified as CWE-78. pnpm interpolates environment variable values into the tokenHelper command string and then executes it via a shell, allowing metacharacters such as ;, &&, |, and backticks in a variable value to break out of the intended command.
Attack Vector
Exploitation requires local access and low privileges: the attacker must influence environment variables read by pnpm. Realistic scenarios include a malicious pull request that modifies workflow environment variables, a compromised dependency that writes to the process environment, or a shared runner where an unprivileged user can set variables consumed by a privileged pnpm invocation. Once pnpm reads .npmrc and expands the poisoned variable into tokenHelper, the injected commands run with the privileges of the build process. See the GitHub Security Advisory GHSA-2phv-j68v-wwqx for the maintainer's technical description.
Detection Methods for CVE-2025-69262
Indicators of Compromise
- Unexpected child processes spawned by pnpm, node, or shell interpreters during pnpm install, pnpm publish, or pnpm fetch operations.
- .npmrc files that define tokenHelper values containing environment variable references combined with shell metacharacters such as ;, &&, |, or `.
- Outbound network connections from build agents to unknown hosts immediately after pnpm registry authentication events.
Detection Strategies
- Inventory all .npmrc files across repositories and build systems, and flag any tokenHelper entries that reference environment variables.
- Alert on pnpm process trees where the child command differs from the configured token helper binary, indicating shell interpretation of injected content.
- Compare installed pnpm versions against 10.27.0 on developer endpoints and CI runners; treat versions in the 6.25.0–10.26.2 range as vulnerable.
Monitoring Recommendations
- Enable process command-line auditing on CI/CD runners to capture the fully expanded tokenHelper command string at execution time.
- Monitor CI workflow definitions for pull request-controlled inputs that flow into environment variables consumed during pnpm steps.
- Review registry authentication logs for token requests originating from unexpected build jobs or repositories.
How to Mitigate CVE-2025-69262
Immediate Actions Required
- Upgrade pnpm to version 10.27.0 or later on all developer workstations, container images, and CI/CD runners.
- Audit every .npmrc in source repositories and user home directories, and remove environment variable substitutions from tokenHelper values until the upgrade is complete.
- Restrict which pipelines and contributors can define or override environment variables in workflows that execute pnpm.
Patch Information
The pnpm maintainers released the fix in version 10.27.0. Full details are available in the pnpm v10.27.0 release notes and the GitHub Security Advisory GHSA-2phv-j68v-wwqx. Users unable to update immediately should treat all tokenHelper inputs as untrusted.
Workarounds
- Replace tokenHelper with a static _authToken sourced from a trusted secret store when upgrading is not immediately feasible.
- Pin tokenHelper to an absolute path to a vetted binary and remove any ${VAR} references from its value.
- Run pnpm in isolated build containers where environment variables originate only from trusted, server-side secrets rather than pull request contexts.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

