跳到主内容

一篇帖子 已标记为 "security"

查看所有标签

Why pnpm no longer expands environment variables in a repository's .npmrc

· 一分钟阅读
Zoltan Kochan
pnpm 的首席维护者

pnpm used to expand ${ENV_VAR} placeholders everywhere it found them — including in the .npmrc and pnpm-workspace.yaml files that live inside the repository you just cloned. That turned out to be a way for a malicious repository to steal the secrets in your environment. As of v10.34.2 and v11.5.3, pnpm stops expanding environment variables in repository-controlled registry and credential settings.

This was a security fix (GHSA-3qhv-2rgh-x77r), and it is a breaking change for some setups. This post explains the attack, what exactly changed, and how to migrate.