Skip to content
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

chore(deps): update pnpm to v9.15.0 [security] #477

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 11, 2024

This PR contains the following updates:

Package Type Update Change OpenSSF
pnpm (source) packageManager minor 9.11.0 -> 9.15.0 OpenSSF Scorecard
pnpm (source) engines minor ^9.0.0 -> ^9.15.0 OpenSSF Scorecard

pnpm no-script global cache poisoning via overrides / ignore-scripts evasion

CVE-2024-53866 / GHSA-vm32-9rqf-rh3r

More information

Details

Summary

pnpm seems to mishandle overrides and global cache:

  1. Overrides from one workspace leak into npm metadata saved in global cache
  2. npm metadata from global cache affects other workspaces
  3. installs by default don't revalidate the data (including on first lockfile generation)

This can make workspace A (even running with ignore-scripts=true) posion global cache and execute scripts in workspace B

Users generally expect ignore-scripts to be sufficient to prevent immediate code execution on install (e.g. when the tree is just repacked/bundled without executing it).

Here, that expectation is broken

Details

See PoC.

In it, overrides from a single run of A get leaked into e.g. ~/Library/Caches/pnpm/metadata/registry.npmjs.org/rimraf.json and persistently affect all other projects using the cache

PoC

Postinstall code used in PoC is benign and can be inspected in https://www.npmjs.com/package/ponyhooves?activeTab=code, it's just a console.log

  1. Remove store and cache
    On mac: rm -rf ~/Library/Caches/pnpm ~/Library/pnpm/store
    This step is not required in general, but we'll be using a popular package for PoC that's likely cached
  2. Create A/package.json:
    {
      "name": "A",
      "pnpm": { "overrides": { "rimraf>glob": "npm:ponyhooves@1" } },
      "dependencies": { "rimraf": "6.0.1" }
    }
    Install it with pnpm i --ignore-scripts (the flag is not required, but the point of the demo is to show that it doesn't help)
  3. Create B/package.json:
    {
      "name": "B",
      "dependencies": { "rimraf": "6.0.1" }
    }
    Install it with pnpm i

Result:

Packages: +3
+++
Progress: resolved 3, reused 3, downloaded 0, added 3, done
node_modules/.pnpm/[email protected]/node_modules/ponyhooves: Running postinstall script, done in 51ms

dependencies:
+ rimraf 6.0.1

Done in 1.4s

Also, that code got leaked into another project and it's lockfile now!

Impact

Global state integrity is lost via operations that one would expect to be secure, enabling subsequently running arbitrary code execution on installs

As a work-around, use separate cache and store dirs in each workspace

Severity

  • CVSS Score: Unknown
  • Vector String: CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:N/VI:L/VA:N/SC:H/SI:H/SA:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Release Notes

pnpm/pnpm (pnpm)

v9.15.0

Compare Source

v9.14.4

Compare Source

v9.14.3

Compare Source

v9.14.2

Compare Source

Patch Changes

  • pnpm publish --json should work #​8788.

Platinum Sponsors

Bit Bit Figma

Gold Sponsors

Discord Prisma
u|screen JetBrains
Nx CodeRabbit
Route4Me

v9.14.1

Compare Source

Minor Changes

  • Added support for pnpm pack --json to print packed tarball and contents in JSON format #​8765.

Patch Changes

  • pnpm exec should print a meaningful error message when no command is provided #​8752.
  • pnpm setup should remove the CLI from the target location before moving the new binary #​8173.
  • Fix ERR_PNPM_TARBALL_EXTRACT error while installing a dependency from GitHub having a slash in branch name #​7697.
  • Don't crash if the use-node-version setting is used and the system has no Node.js installed #​8769.
  • Convert settings in local .npmrc files to their correct types. For instance, child-concurrency should be a number, not a string #​5075.
  • pnpm should fail if a project requires a different package manager even if manage-package-manager-versions is set to true.
  • pnpm init should respect the --dir option #​8768.

Platinum Sponsors

Bit Bit Figma

Gold Sponsors

Discord Prisma
u|screen JetBrains
Nx CodeRabbit
Route4Me

v9.14.0

Compare Source

v9.13.2: pnpm 9.13.2

Compare Source

Patch Changes

  • Detection of circular peer dependencies should not crash with aliased dependencies #​8759. Fixes a regression introduced in the previous version.
  • Fix race condition of symlink creations caused by multiple parallel dlx processes.

Platinum Sponsors

Bit Bit Figma

Gold Sponsors

Discord Prisma
u|screen JetBrains
Nx CodeRabbit
Route4Me

Silver Sponsors

Leniolabs_ Vercel
Depot moonrepo
devowl.io Cerbos
vlt Vite

v9.13.1: pnpm 9.13.1

Compare Source

Patch Changes

  • Fixed some edge cases where resolving circular peer dependencies caused a dead lock #​8720.

Platinum Sponsors

Bit Bit Figma

Gold Sponsors

Discord Prisma
u|screen JetBrains
Nx CodeRabbit
Route4Me

Silver Sponsors

Leniolabs_ Vercel
Depot moonrepo
devowl.io Cerbos
vlt Vite

v9.13.0: pnpm 9.13

Compare Source

Minor Changes

  • The self-update now accepts a version specifier to install a specific version of pnpm. E.g.:

    pnpm self-update 9.5.0
    

    or

    pnpm self-update next-10
    

Patch Changes

  • Fix Cannot read properties of undefined (reading 'name') that is printed while trying to render the missing peer dependencies warning message #​8538.

Platinum Sponsors

Bit Figma

Gold Sponsors

Discord Prisma
u|screen JetBrains
Nx CodeRabbit
Route4Me

Silver Sponsors

Leniolabs_ Vercel
Depot moonrepo
devowl.io Cerbos
vlt Vite

v9.12.3

Compare Source

Patch Changes
  • Don't purge node_modules, when typing "n" in the prompt that asks whether to remove node_modules before installation #​8655.
  • Fix a bug causing pnpm to infinitely spawn itself when manage-package-manager-versions=true is set and the .tools directory is corrupt.
  • Use crypto.hash, when available, for improved performance #​8629.
  • Fixed a race condition in temporary file creation in the store by including worker thread ID in filename. Previously, multiple worker threads could attempt to use the same temporary file. Temporary files now include both process ID and thread ID for uniqueness #​8703.
  • All commands should read settings from the package.json at the root of the workspace #​8667.
  • When manage-package-manager-versions is set to true, errors spawning a self-managed version of pnpm will now be shown (instead of being silent).
  • Pass the find command to npm, it is an alias for npm search

v9.12.2

Compare Source

Patch Changes
  • When checking whether a file in the store has executable permissions, the new approach checks if at least one of the executable bits (owner, group, and others) is set to 1. Previously, a file was incorrectly considered executable only when all the executable bits were set to 1. This fix ensures that files with any executable permission, regardless of the user class, are now correctly identified as executable #​8546.

v9.12.1

Compare Source

Patch Changes
  • pnpm update --latest should not update the automatically installed peer dependencies #​6657.
  • pnpm publish should be able to publish from a local tarball #​7950.
  • The pnpx command should work correctly on Windows, when pnpm is installed via the standalone installation script #​8608.
  • Prevent EBUSY errors caused by creating symlinks in parallel dlx processes #​8604.
  • Fix maximum call stack size exceeded error related to circular workspace dependencies #​8599.

v9.12.0

Compare Source

Minor Changes
  • Fix peer dependency resolution dead lock #​8570. This change might change some of the keys in the snapshots field inside pnpm-lock.yaml but it should happen very rarely.

  • pnpm outdated command supports now a --sort-by=name option for sorting outdated dependencies by package name #​8523.

  • Added the ability for overrides to remove dependencies by specifying "-" as the field value #​8572. For example, to remove lodash from the dependencies, use this configuration in package.json:

    {
      "pnpm": {
        "overrides": {
          "lodash": "-"
        }
      }
    }
Patch Changes
  • Fixed an issue where pnpm list --json pkg showed "private": false for a private package #​8519.
  • Packages with libc that differ from pnpm.supportedArchitectures.libc are not downloaded #​7362.
  • Prevent ENOENT errors caused by running store prune in parallel #​8586.
  • Add issues alias to pnpm bugs #​8596.

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Copy link

vercel bot commented Dec 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
transmascfutures ❌ Failed (Inspect) Dec 11, 2024 7:38am

@renovate renovate bot requested a review from JoeKarow as a code owner December 11, 2024 07:38
@renovate renovate bot added automerge Enable Kodiak auto-merge dependencies Change in project dependencies. security Addressing a vulnerability or security risk in this project. labels Dec 11, 2024
Copy link

coderabbitai bot commented Dec 11, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or <!-- #coderabbitai summary --> to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

sonarcloud bot commented Dec 11, 2024

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] environment, filesystem, unsafe 0 7.7 MB prettier-bot

🚮 Removed packages: npm/[email protected], npm/[email protected]

View full report↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Enable Kodiak auto-merge dependencies Change in project dependencies. security Addressing a vulnerability or security risk in this project.
Development

Successfully merging this pull request may close these issues.

0 participants