CVE-2024-53866 pnpm vulnerable to no-script global cache poisoning via overrides / `ignore-scripts` evasion

Medium 5.8 Published Updated

Attackers can poison the global cache via workspace overrides to execute arbitrary scripts in other workspaces, bypassing ignore-scripts protections.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-53866?

CVE-2024-53866 is a medium-severity vulnerability in pnpm, published on 10 Dec 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

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.

Weakness: CWE-426

Which versions are affected by CVE-2024-53866?

2 open source packages ship an affected version, including pnpm. It affects 1 product.

PackageAffectedFixed in
pnpm npmAll versions9.15.0
pnpm npmAll versions9.15.0

Products include Pnpm Pnpm.

How do I fix CVE-2024-53866?

Upgrade pnpm to 9.15.0 or later.

Is CVE-2024-53866 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-53866 exists.

Sources

Also known as GHSA-vm32-9rqf-rh3r, MINI-3999-f27p-cf9c.

Is CVE-2024-53866 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free