Vulnerability · Published Dec 10, 2024 · Assigned by GitHub_M
CVE-2024-53866pnpm vulnerable to no-script global cache poisoning via overrides / `ignore-scripts` evasion
Medium 5.8
In plain English
A medium-severity security flaw in pnpm from pnpm. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.0% (higher than 62% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
The package manager pnpm prior to version 9.15.0 seems to mishandle overrides and global cache: Overrides from one workspace leak into npm metadata saved in global cache; npm metadata from global cache affects other workspaces; and 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. Global state integrity is lost via operations that one would expect to be secure, enabling subsequently running arbitrary code execution on installs. Version 9.15.0 fixes the issue. As a work-around, use separate cache and store dirs in each workspace.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | pnpm | 9.15.0 | GHSA-vm32-9rqf-rh3r |
Affected products (as reported)
Weakness: CWE-426 · Vector: 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
- https://github.com/pnpm/pnpm/security/advisories/GHSA-vm32-9rqf-rh3r x_refsource_CONFIRM
- https://github.com/pnpm/pnpm/commit/11afcddea48f25ed5117a87dc1780a55222b9743 x_refsource_MISC