GitHub Advisoryadvisory · npm

GHSA-vx52-2968-3vc6 pnpm: Environment secrets exfiltrated via env-placeholder expansion in proxy settings read from an untrusted pnpm-workspace.yaml

HIGH Published 2026-09-01 Modified 2026-09-01 Official page ↗
Ecosystem
npm
Packages
pnpm
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
Weaknesses
CWE-201, CWE-319, CWE-522
Reviewed
2026-09-01

Affected packages

• npm pnpm: >= 11.0.0, < 11.11.0 → fixed in 11.11.0 • npm pnpm: >= 10.7.0, < 10.34.5 → fixed in 10.34.5

Description

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 `NPM_TOKEN` or `GITHUB_TOKEN`. 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, `node_modules`, 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, = 10.7.0, `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.

Related

Weakness · CWE (3)

  • CWE-201 Insertion of Sensitive Information Into Sent Data weakness
  • CWE-319 Cleartext Transmission of Sensitive Information weakness
  • CWE-522 Insufficiently Protected Credentials weakness

References