PkgApplication · Vercel

CVE-2024-24828

HIGH · 7.8 CVSS v3.1 Published 2024-02-09
Fix available
A fix is available. Upgrade to after 5.8.1 or later.
See remediation →
80/100
Remediation priority · High
Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The pkg tool writes bundled native code packages to a predictable, hardcoded path (/tmp/pkg/*) shared by all users on Unix systems. An attacker with local access can replace executables in this directory with malicious equivalents before a victim runs them, achieving arbitrary code execution.

MitigationSince pkg is deprecated with no patch, migrate to actively maintained alternatives such as Node.js 21's native single executable application support or other bundling tools with secure temporary directory handling.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
PkgApplication
Affected:<= 5.8.1

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
Low
Privileges
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check if pkg is installed
    Run 'which pkg' or 'pkg --version' in the terminal
    Affected if pkg is installed and returns a version number
  2. Identify the installed pkg version
    Run 'pkg --version' and compare the output to '5.8.1' - note that versions may be formatted as 'pkg 5.x.x'
    Affected if The version number is 5.8.1 or lower (including 5.x.x variants below 5.8.1)
  3. Check for the vulnerable temp directory
    Run 'ls -la /tmp/pkg/' to see if the directory exists and what files are present
    Affected if The /tmp/pkg/ directory exists and contains executable files or directories that could be tampered with
  4. Verify the shared directory is accessible
    Run 'ls -ld /tmp/pkg/' to check directory permissions - any local user having write access to this directory indicates exposure
    Affected if The directory is world-writable or group-writable, allowing any local user to place files there

A user is affected if pkg version 5.8.1 or lower is installed AND the /tmp/pkg/ directory is present and accessible on the system.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to a release after 5.8.1
Interim mitigation

Since pkg is deprecated with no patch, migrate to actively maintained alternatives such as Node.js 21's native single executable application support or other bundling tools with secure temporary directory handling.

Recommended fix High confidence
  1. 1. Identify all applications using the `pkg` package for creating executables.
  2. 2. Review the application's functionality to understand the requirements for single-file executable generation.
  3. 3. Migrate to Node.js 21's built-in single executable application (SEA) feature as the official alternative.
  4. 4. Alternatively, evaluate other actively maintained packaging solutions such as `electron-builder`, `nexe`, or `enclose.io` based on project requirements.
  5. 5. Rebuild all applications using the new packaging solution.
  6. 6. Remove the deprecated `pkg` package from project dependencies and CI/CD pipelines.
  7. 7. Audit existing deployed executables for any signs of compromise in `/tmp/pkg/` directories.
Caveat Migrating to alternative packaging solutions may require code changes and testing; Node.js 21 SEA has different configuration requirements than pkg

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Pkg Scoped from the published advisory
  • Consultation4.0 h
  • Implementation16.0 h
  • Testing8.0 h
  • Review / QA4.0 h
32.0 hours of engineering $5,600
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $8,960.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2024-24828 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-24828 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data