-
Notifications
You must be signed in to change notification settings - Fork 804
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
Update pnpm to v9.15.0 [SECURITY] #40560
Conversation
|
07ab4b0
to
c5aafa8
Compare
c5aafa8
to
116b05d
Compare
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
Sorry, I've been somewhat ignoring this because I don't see that CVE-2024-53866 was affecting us and I'll probably have to resurrect the workaround for pnpm/pnpm#3935 since it was regressed in 9.12.0. |
Thanks for explaining! Why is it not affecting us, if I may ask? |
We're not using overrides anywhere. |
Though if I'm reading the issue correctly, should a different repo use malicious overrides, it could affect the monorepo when running |
Hmm, maybe. |
This PR contains the following updates:
9.3.0
->9.15.0
^9.3.0 <9.12.0
->^9.15.0 <9.15.1
pnpm no-script global cache poisoning via overrides /
ignore-scripts
evasionCVE-2024-53866 / GHSA-vm32-9rqf-rh3r
More information
Details
Summary
pnpm seems to mishandle overrides and global cache:
This can make workspace A (even running with
ignore-scripts=true
) posion global cache and execute scripts in workspace BUsers 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 cachePoC
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
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
A/package.json
:pnpm i --ignore-scripts
(the flag is not required, but the point of the demo is to show that it doesn't help)B/package.json
:pnpm i
Result:
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: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
: pnpm 9.15Compare Source
Minor Changes
Patch Changes
pnpm update --global
should not crash if there are no any global packages installed #7898.pnpm update --interactive
if catalogs are used.Platinum Sponsors
Gold Sponsors
v9.14.4
: pnpm 9.14.4Compare Source
Patch Changes
Platinum Sponsors
Gold Sponsors
Silver Sponsors
v9.14.3
: pnpm 9.14.3Compare Source
Patch Changes
packageManager
field check ofpackage.json
#7959.Platinum Sponsors
Gold Sponsors
Silver Sponsors
v9.14.2
Compare Source
Patch Changes
pnpm publish --json
should work #8788.Platinum Sponsors
Gold Sponsors
v9.14.1
Compare Source
Minor Changes
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.ERR_PNPM_TARBALL_EXTRACT
error while installing a dependency from GitHub having a slash in branch name #7697.use-node-version
setting is used and the system has no Node.js installed #8769..npmrc
files to their correct types. For instance,child-concurrency
should be a number, not a string #5075.manage-package-manager-versions
is set totrue
.pnpm init
should respect the--dir
option #8768.Platinum Sponsors
Gold Sponsors
v9.14.0
Compare Source
v9.13.2
: pnpm 9.13.2Compare Source
Patch Changes
dlx
processes.Platinum Sponsors
Gold Sponsors
Silver Sponsors
v9.13.1
: pnpm 9.13.1Compare Source
Patch Changes
Platinum Sponsors
Gold Sponsors
Silver Sponsors
v9.13.0
: pnpm 9.13Compare Source
Minor Changes
The
self-update
now accepts a version specifier to install a specific version of pnpm. E.g.:or
Patch Changes
Cannot read properties of undefined (reading 'name')
that is printed while trying to render the missing peer dependencies warning message #8538.Platinum Sponsors
Gold Sponsors
Silver Sponsors