-
Notifications
You must be signed in to change notification settings - Fork 3.4k
harden: this pnpm workspace configuration does not set ... in... #4504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| packages: | ||
| - 'packages/*' | ||
| - 'packages/*' | ||
|
|
||
| minimumReleaseAge: 10080 | ||
| blockExoticSubdeps: true | ||
| trustPolicy: no-downgrade | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When CI, release, or local installations use the repository's declared How this was verified: The new options were compared with the repository's |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: less/less.js
Length of output: 516
🏁 Script executed:
Repository: less/less.js
Length of output: 226
🌐 Web query:
Official pnpm documentation for minimumReleaseAge, blockExoticSubdeps, trustPolicy, and the pnpm versions that introduced each setting💡 Result:
The pnpm settings minimumReleaseAge, blockExoticSubdeps, and trustPolicy are documented under pnpm's supply chain security features [1][2]. minimumReleaseAge This setting defines the minimum number of minutes that must pass after a package version is published before pnpm will install it [3][4]. It was introduced in pnpm v10.16 [4]. Starting in pnpm v11, it defaults to 1440 (1 day) [5]. blockExoticSubdeps When enabled (set to true), this setting prevents transitive dependencies from using exotic sources such as git repositories or direct tarball URLs [3][6]. It ensures that all transitive dependencies are resolved from trusted sources like registries, local file paths, or workspace links [3][7]. It was introduced in pnpm v10.26 [6] and defaults to true starting in pnpm v11 [5]. trustPolicy This setting is used to enforce trust during package installation [1]. When set to no-downgrade, pnpm will fail to install a package if its trust level has decreased compared to previous releases (e.g., if it loses provenance or a trusted publisher status) [3][1]. Information regarding the specific version that introduced trustPolicy is not explicitly detailed in the provided documentation, but it is documented alongside other security features that were finalized or enhanced in the v10 and v11 release cycles [1][2]. All of these settings are configured in the pnpm-workspace.yaml file [3][8][7].
Citations:
🏁 Script executed:
Repository: less/less.js
Length of output: 4091
🌐 Web query:
site:pnpm.io/blog/releases trustPolicy pnpm 10.21💡 Result:
The trustPolicy setting was introduced in pnpm 10.21 [1]. It is a security configuration designed to help prevent the installation of potentially compromised packages [1]. When set to no-downgrade, pnpm will fail to install a package if its trust level has decreased compared to previously installed versions [1]. For instance, if a package was previously published by a trusted publisher but a subsequent version only provides provenance or no trust evidence, the installation will be blocked [1]. In subsequent releases, pnpm added further refinements to this feature: 1. Exclusions: pnpm 10.22 introduced trustPolicyExclude, allowing users to list specific packages or versions to be ignored by the trust policy [2]. 2. Prerelease Handling: pnpm 10.24 updated the logic to ignore trust evidence from prerelease versions when installing a non-prerelease version, ensuring that a trusted prerelease version does not erroneously block the installation of a stable release lacking similar evidence [3]. 3. Additional Fixes: Later versions, including 11.9 and 11.11-11.14, included bug fixes to improve the behavior of trustPolicyExclude and ensure consistency across various operations, such as pnpm self-update and global commands [4][5].
Citations:
Upgrade the pnpm pin before enabling these policies.
package.jsonpinspnpm@9.15.9, and CI uses that version. This version reports all three settings asundefined, so the policies are not enforced. Upgrade the pin topnpm@10.26.0or newer, then validate the frozen-lockfile CI install.🤖 Prompt for AI Agents
Source: MCP tools