pnpm

CVE-2025-69262

CVE-2025-69262 is a high-severity OS command injection vulnerability in pnpm (npm), affecting versions >= 6.25.0, < 10.27.0. It is fixed in 10.27.0.

Key facts
CVSS score
7.5
High
Attack vector
Local
Issuing authority
GitHub Advisory Database
Affected package
pnpm
Fixed in
10.27.0
Disclosed
2025

Summary

Summary A command injection vulnerability exists in pnpm when using environment variable substitution in .npmrc configuration files with tokenHelper settings. An attacker who can control environment variables during pnpm operations could achieve remote code execution (RCE) in build environments. Affected Components Package: pnpm Versions: All versions using @pnpm/config.env-replace and loadToken functionality File: pnpm/network/auth-header/src/getAuthHeadersFromConfig.ts - loadToken() function File: pnpm/config/config/src/readLocalConfig.ts - .npmrc environment variable substitution Technical Details Vulnerability Chain Environment Variable Substitution .npmrc supports ${VAR} syntax Substitution occurs in readLocalConfig() loadToken Execution Uses spawnSync(helperPath, { shell: true }) Only validates absolute path existence Attack Flow Code Evidence pnpm/config/config/src/readLocalConfig.ts:17-18 pnpm/network/auth-header/src/getAuthHeadersFromConfig.ts:60-71 Proof of Concept Prerequisites Private npm registry access Control over environment variables Ability to place scripts in filesystem PoC Steps PoC Results Impact Severity CVSS Score: 7.6 (High) CVSS Vector: cvss:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H Affected Environments High Risk: CI/CD pipelines (GitHub Actions, GitLab CI) Docker build environments Kubernetes deployments Private registry users Low Risk: Public registry only Production runtime (no pnpm execution) Static sites Attack Scenarios Scenario 1: CI/CD Supply Chain Scenario 2: Docker Build Scenario 3: Kubernetes Mitigation Temporary Workarounds Disable tokenHelper: Use direct tokens: Audit environment variables: Review CI/CD env vars Restrict .npmrc changes Monitor build logs Recommended Fixes Remove shell: true from loadToken Implement helper path allowlist Validate substituted paths Consider sandboxing Disclosure Discovery: 2025-11-02 PoC: 2025-11-02 Report: [Pending disclosure decision] References Repository: https://github.com/pnpm/pnpm Affected: @pnpm/config.env-replace@^3.0.2 Similar: CVE-2024-53866, CVE-2023-37478 Credit Reported by: Jiyong Yang Contact: [email protected]

Impact

What is OS command injection?

Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.

Severity and exposure

CVE-2025-69262 has a CVSS score of 7.5 (High). The vector is requires local access, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (10.27.0). Upgrading removes the vulnerable code path.

Affected versions

npm

  • pnpm (>= 6.25.0, < 10.27.0)

Security releases

  • pnpm → 10.27.0 (npm)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's Application Detection and Response identifies whether CVE-2025-69262 is reachable in your applications. Explore runtime application protection for your team.

See if CVE-2025-69262 is reachable in your applications. Get a demo

Already deployed Kodem? See CVE-2025-69262 in your environment

Remediation advice

Upgrade pnpm to 10.27.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2025-69262

What is CVE-2025-69262?

CVE-2025-69262 is a high-severity OS command injection vulnerability in pnpm (npm), affecting versions >= 6.25.0, < 10.27.0. It is fixed in 10.27.0. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.

How severe is CVE-2025-69262?

CVE-2025-69262 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of pnpm are affected by CVE-2025-69262?

pnpm (npm) versions >= 6.25.0, < 10.27.0 is affected.

Is there a fix for CVE-2025-69262?

Yes. CVE-2025-69262 is fixed in 10.27.0. Upgrade to this version or later.

Is CVE-2025-69262 exploitable, and should I be worried?

Whether CVE-2025-69262 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2025-69262 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2025-69262?

Upgrade pnpm to 10.27.0 or later.

Stop the waste.
Protect your environment with Kodem.