CVE-2025-69264: pnpm v10+ Bypass "Dependency lifecycle scripts execution disabled by default"

Published Jan 7, 2026
·
Updated

pnpm v10+ Git Dependency Script Execution Bypass

Summary

A security bypass vulnerability in pnpm v10+ allows git-hosted dependencies to execute arbitrary code during pnpm install, circumventing the v10 security feature "Dependency lifecycle scripts execution disabled by default". While pnpm v10 blocks postinstall scripts via the onlyBuiltDependencies mechanism, git dependencies can still execute prepare, prepublish, and prepack scripts during the fetch phase, enabling remote code execution without user consent or approval.

Details

pnpm v10 introduced a security feature to disable dependency lifecycle scripts by default (PR #8897). This is implemented by setting onlyBuiltDependencies = [] when no build policy is configured:

File: pkg-manager/core/src/install/extendInstallOptions.ts (lines 290-291) typescript if (opts.neverBuiltDependencies == null && opts.onlyBuiltDependencies == null && opts.onlyBuiltDependenciesFile == null) { opts.onlyBuiltDependencies = [] }

This creates an allowlist that blocks all packages from running scripts during the BUILD phase in exec/build-modules/src/index.ts.

However, git-hosted dependencies are processed differently. During the FETCH phase, git packages are prepared using preparePackage():

File: exec/prepare-package/src/index.ts (lines 28-57) typescript export async function preparePackage (opts: PreparePackageOptions, gitRootDir: string, subDir: string) { // ... if (opts.ignoreScripts) return { shouldBeBuilt: true, pkgDir } // Only checks ignoreScripts, not onlyBuiltDependencies

const execOpts: RunLifecycleHookOptions = { // ... rawConfig: omit(['ignore-scripts'], opts.rawConfig), // Explicitly removes ignore-scripts! }

// Runs npm/pnpm install await runLifecycleHook(installScriptName, manifest, execOpts)

// Runs prepare scripts for (const scriptName of PREPUBLISHSCRIPTS) { // ['prepublish', 'prepack', 'publish'] await runLifecycleHook(newScriptName, manifest, execOpts) } }

The ignoreScripts option defaults to false and is completely separate from onlyBuiltDependencies. The onlyBuiltDependencies allowlist is never consulted during the fetch phase.

Affected scripts that execute during fetch: - prepare - prepublish - prepack

Attack vectors: - git+https://github.com/attacker/malicious.git - github:attacker/malicious - gitlab:attacker/malicious - bitbucket:attacker/malicious - git+ssh://git@github.com/attacker/malicious.git - git+file:///path/to/local/repo

PoC

Prerequisites: - pnpm v10.0.0 or later (tested on v10.23.0 and v11.0.0-alpha.1) - git

Steps to reproduce:

1. Extract the attached poc.zip

2. Run the PoC script: bash cd poc chmod +x run-poc.sh ./run-poc.sh

3. Verify the marker file was created by the malicious script: bash cat /tmp/pnpm-vuln-poc-marker.txt

Manual reproduction:

1. Create a malicious package with a prepare script: json { "name": "malicious-pkg", "version": "1.0.0", "scripts": { "prepare": "node -e \"require('fs').writeFileSync('/tmp/pwned.txt', 'RCE!')\"" } }

2. Initialize it as a git repo and commit the files

3. Create a victim project that depends on it (just have to make sure it actually git clones and not just downloads a tarball): json { "dependencies": { "malicious-pkg": "git+file:///path/to/malicious-pkg" } }

4. Run pnpm install - the prepare script executes without any warning or approval prompt

Impact

Severity: High

Who is impacted: - All pnpm v10+ users - Users who believed they were protected by the v10 "scripts disabled by default" feature - CI/CD pipelines

Attack scenarios: 1. Supply chain attack: An attacker compromises a dependency, adding to it a malicious git dependency that executes arbitrary code during pnpm install

What an attacker can do: - Execute arbitrary code with the victim's privileges - Exfiltrate environment variables, secrets, and credentials - Modify source code or inject backdoors - Establish persistence or reverse shells - Access the filesystem and network

Why this bypasses security expectations: - pnpm v10 changelog explicitly states "Lifecycle scripts of dependencies are not executed during installation by default" - Users expect git dependencies to follow the same security model as npm registry packages - There is no warning that git dependencies are treated differently - The onlyBuiltDependencies configuration does not affect git dependencies

Other sources

pnpm is a package manager. Versions 10.0.0 through 10.25 allow git-hosted dependencies to execute arbitrary code during pnpm install, circumventing the v10 security feature "Dependency lifecycle scripts execution disabled by default". While pnpm v10 blocks postinstall scripts via the onlyBuiltDependencies mechanism, git dependencies can still execute prepare, prepublish, and prepack scripts during the fetch phase, enabling remote code execution without user consent or approval. This issue is fixed in version 10.26.0.

MITRE

Affected Software

2 affected componentsFixes available
npm/pnpm>=10.0.0<10.26.0
10.26.0
PNPM PNPM>=10.0.0<10.26.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/pnpm to a version that resolves this vulnerability.

    Fixed in 10.26.0
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 10.26.0

Event History

Jan 7, 2026
Advisory Published
via GitHub·07:07 PM
Data Sourced
via GitHub·07:07 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·09:53 PM
Data Sourced
via MITRE·09:53 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·10:02 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·10:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 26, 2026
News Published
via BleepingComputer·02:02 PM
News Published
via BleepingComputer·02:04 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-69264?

CVE-2025-69264 is a critical vulnerability that allows arbitrary code execution during package installation.

2

How do I fix CVE-2025-69264?

To fix CVE-2025-69264, upgrade pnpm to version 10.26.0 or higher.

3

What versions of pnpm are affected by CVE-2025-69264?

CVE-2025-69264 affects pnpm versions from 10.0.0 to 10.25.99.

4

Can CVE-2025-69264 allow unauthorized access to my system?

Yes, CVE-2025-69264 can potentially allow unauthorized code execution, compromising system security.

5

Is there a workaround for CVE-2025-69264 if I cannot upgrade immediately?

There are no confirmed workarounds for CVE-2025-69264, and upgrading is the recommended action.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203