/

CVE-2026-55697

Severity:

HIGH RISK

(7.5)

Command Execution (CWE-78) via pnpm configDependencies abuse

CVE-2026-55697

Analyzed

Vulnerability type

Category:

Command Injection / Untrusted Binary Execution

CWE:

CWE-78, CWE-494, CWE-829

Impact:

Arbitrary Command Execution in Developer and CI Environments

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

pnpm's handling of workspace configDependencies can allow a repository to supply and execute a custom install engine binary before normal command dispatch.

When a project declares pacquet or @pnpm/pacquet as a configuration dependency, pnpm may resolve and spawn a repository-controlled platform-specific binary, enabling unintended command execution in developer or CI environments.

Affected context

This vulnerability occurs in pnpm-based JavaScript/Node.js workspaces that use pnpm-workspace.yaml and permit projects to define configDependencies.

In affected versions, a repository can declare pacquet or @pnpm/pacquet as configuration dependencies, causing pnpm to treat them as install-engine opt-ins and load binaries from node_modules/.pnpm-config.

The issue is most relevant in scenarios where developers run pnpm install on untrusted or partially trusted repositories, or CI pipelines automatically execute workspace installs based on repository content.

Exploit preconditions

  • Attack surface: Developer machines and CI runners executing pnpm install or related commands in an affected workspace.
  • Required access: Ability to modify or control the repository, including pnpm-workspace.yaml and dependencies under version control (e.g., via pull request, compromised repo, or malicious template).
  • Trigger point: Running pnpm commands that process configDependencies, causing pnpm to resolve @pacquet/<platform>-<arch>/pacquet from node_modules/.pnpm-config/<packageName> and spawn it.
  • Why exploitation is possible: pnpm implicitly trusts repository-declared configDependencies as install-engine opt-ins and executes the resolved binary with the privileges of the invoking user or CI service, without sufficient separation between configuration and execution.

Why this happens

The root cause is the implicit execution of repository-controlled binaries during configuration processing, rather than limiting configuration to declarative, non-executable data.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), because the tool permits untrusted configuration to influence which binaries are executed, effectively giving attackers a path to spawn arbitrary commands.

It also aligns with CWE-494: Download of Code Without Integrity Check, as the install engine binary resolved from node_modules/.pnpm-config may lack robust authenticity validation, and CWE-829: Inclusion of Functionality from Untrusted Control Sphere, since functionality loaded from the repository-controlled workspace is treated as trusted infrastructure code.

Potential impact

  • Malicious code execution on developer workstations during pnpm install.
  • Compromise of CI runners, allowing attackers to read secrets, tamper with build artifacts, or pivot to other services.
  • Silent modification of dependency trees, lockfiles, or generated assets to inject backdoors or supply-chain malware.
  • Execution of arbitrary OS-level commands under the context of the developer or automated build user.

General mitigation guidance

Mitigation generally focuses on restricting the execution of repository-controlled configuration code and treating workspace metadata as untrusted input by default.

Secure patterns include:

  • Ensuring that configuration mechanisms (like configDependencies) do not implicitly permit the execution of binaries sourced from the repository without explicit, trusted opt-in.
  • Separating install engines or helper binaries from project-controlled directories, and validating the origin and integrity of any executable used as part of the package manager workflow.
  • Reducing trust in repositories fetched from external sources by running installs in hardened, least-privilege environments and avoiding direct execution of workspace-provided tooling.
  • Applying policy controls that forbid or closely review configuration entries that can influence which binaries are spawned during package installation.

How teams detect issues like this

Detection efforts can focus on:

  • Static inspection of pnpm-workspace.yaml for configDependencies that reference install engines or binaries, especially pacquet or @pnpm/pacquet.
  • Code review checks and repository policies that flag any configuration capable of injecting or altering the install engine path.
  • Security scanning of CI configuration to ensure that pnpm runs in isolated, ephemeral environments and does not trust workspace-provided binaries without validation.
  • Monitoring installation logs and process creation events on developer and CI systems to detect unexpected execution from node_modules/.pnpm-config or other repository-controlled locations.

Sources

SourceLink
github.comgithub.com/pnpm/pnpm/security/advisories/GHSA-gj8w-mvpf-x27x

Frequently asked

questions

Exploitability is primarily scoped to environments where developers or CI systems run pnpm on repositories that attackers can influence. If an attacker can modify the workspace configuration or dependencies, they can potentially cause arbitrary binary execution during install.

An attacker needs write access to the repository or a way to get malicious changes merged or executed, such as a compromised contributor account, a malicious fork that is cloned and used, or an unreviewed template that defines dangerous configDependencies.

The safest pattern is to prevent configuration from implicitly executing repository-controlled binaries. Configuration entries should be treated as data, not code; install engines and similar binaries should come from trusted, verified sources, with strict checks on what can be spawned during package operations.

Teams can enforce policies that restrict executable code sourced from workspace configuration, add automated review for package manager metadata (like pnpm-workspace.yaml), and run dependency installs in locked-down environments. Additionally, they should treat build tooling as part of the supply chain, applying integrity checks and least-privilege principles to any binaries invoked during installs.

Find out what's already
exploitable in your codebase.