CVE-2024-24828 Local Privilege Escalation in execuatables bundled by pkg

Medium 6.6 Published Updated

Local attackers can replace predictable native code files in a shared directory to execute malicious code when users run bundled executables.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2024-24828?

CVE-2024-24828 is a medium-severity vulnerability in vercel pkg, published on 9 Feb 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

pkg is tool design to bundle Node.js projects into an executables. Any native code packages built by `pkg` are written to a hardcoded directory. On unix systems, this is `/tmp/pkg/*` which is a shared directory for all users on the same local system. There is no uniqueness to the package names within this directory, they are predictable. An attacker who has access to the same local system has the ability to replace the genuine executables in the shared directory with malicious executables of the same name. A user may then run the malicious executable without realising it has been modified. This package is deprecated. Therefore, there will not be a patch provided for this vulnerability. To check if your executable build by pkg depends on native code and is vulnerable, run the executable and check if `/tmp/pkg/` was created. Users should transition to actively maintained alternatives. We would recommend investigating Node.js 21’s support for single executable applications. Given the decision to deprecate the pkg package, there are no official workarounds or remediations provided by our team. Users should prioritize migrating to other packages that offer similar functionality with enhanced security.

Weakness: CWE-276

Which versions are affected by CVE-2024-24828?

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

PackageAffectedFixed in
pkg npmAll versions to 5.8.1None
pkg npmAll versions to 5.8.1None

Products include Vercel Pkg.

How do I fix CVE-2024-24828?

No fix has been published for CVE-2024-24828 yet. Limit exposure of the affected software until one is available.

Is CVE-2024-24828 being exploited?

There is no known exploitation of CVE-2024-24828 in the wild and no public exploit code.

Sources

Also known as GHSA-22r3-9w55-cj54.

Is CVE-2024-24828 in your software?

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

Check your SBOMs for free