CVE-2025-69262

7.5 HIGH

📋 TL;DR

This CVE describes a command injection vulnerability in pnpm package manager versions 6.25.0 through 10.26.2. Attackers who can control environment variables during pnpm operations can achieve remote code execution in build environments. This affects developers and CI/CD systems using vulnerable pnpm versions.

💻 Affected Systems

Products:
  • pnpm
Versions: 6.25.0 through 10.26.2
Operating Systems: All platforms where pnpm runs
Default Config Vulnerable: ✅ No
Notes: Requires environment variable substitution in .npmrc configuration files with tokenHelper settings to be exploitable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full remote code execution on build servers leading to complete system compromise, data theft, and lateral movement within infrastructure.

🟠

Likely Case

Build environment compromise leading to supply chain attacks, credential theft, and malicious code injection into production artifacts.

🟢

If Mitigated

Limited impact with proper environment variable controls and network segmentation, potentially only affecting isolated build containers.

🌐 Internet-Facing: MEDIUM - Build servers exposed to external contributions or automated builds from untrusted sources are at risk.
🏢 Internal Only: HIGH - Internal CI/CD pipelines and developer workstations using vulnerable versions are primary targets.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires attacker control over environment variables during pnpm operations, which is plausible in CI/CD environments or shared development systems.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 10.27.0

Vendor Advisory: https://github.com/pnpm/pnpm/security/advisories/GHSA-2phv-j68v-wwqx

Restart Required: No

Instructions:

1. Update pnpm globally: npm install -g pnpm@10.27.0
2. Update pnpm in project dependencies: pnpm add -D pnpm@10.27.0
3. Update CI/CD pipeline configurations to use pnpm@10.27.0
4. Verify all build environments use patched version

🔧 Temporary Workarounds

Disable tokenHelper in .npmrc

all

Remove or disable tokenHelper configuration in .npmrc files to prevent environment variable substitution.

Remove any lines containing 'tokenHelper' from .npmrc files

Restrict environment variable access

all

Limit which environment variables are exposed to pnpm processes in CI/CD pipelines.

Review and sanitize environment variables in build scripts and CI/CD configurations

🧯 If You Can't Patch

  • Implement strict environment variable controls in CI/CD pipelines
  • Isolate build environments using containers with minimal privileges

🔍 How to Verify

Check if Vulnerable:

Check pnpm version: pnpm --version. If version is between 6.25.0 and 10.26.2 inclusive, and .npmrc uses tokenHelper with environment variables, system is vulnerable.

Check Version:

pnpm --version

Verify Fix Applied:

Run pnpm --version and confirm version is 10.27.0 or higher.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected command execution during pnpm operations
  • Suspicious environment variable usage in build logs
  • Failed pnpm operations with command injection errors

Network Indicators:

  • Unexpected outbound connections from build servers during package installation

SIEM Query:

Process execution where parent process contains 'pnpm' and command contains suspicious shell metacharacters

🔗 References

📤 Share & Export