CVE-2024-24828
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 · uneditedpkg 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 confidenceThe 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.
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<= 5.8.1CVSS 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 checksWork through these to decide whether this CVE applies to you.
-
Check if pkg is installedRun 'which pkg' or 'pkg --version' in the terminalAffected if pkg is installed and returns a version number
-
Identify the installed pkg versionRun '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)
-
Check for the vulnerable temp directoryRun 'ls -la /tmp/pkg/' to see if the directory exists and what files are presentAffected if The /tmp/pkg/ directory exists and contains executable files or directories that could be tampered with
-
Verify the shared directory is accessibleRun 'ls -ld /tmp/pkg/' to check directory permissions - any local user having write access to this directory indicates exposureAffected 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.
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 · scopedSince 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.
- 1. Identify all applications using the `pkg` package for creating executables.
- 2. Review the application's functionality to understand the requirements for single-file executable generation.
- 3. Migrate to Node.js 21's built-in single executable application (SEA) feature as the official alternative.
- 4. Alternatively, evaluate other actively maintained packaging solutions such as `electron-builder`, `nexe`, or `enclose.io` based on project requirements.
- 5. Rebuild all applications using the new packaging solution.
- 6. Remove the deprecated `pkg` package from project dependencies and CI/CD pipelines.
- 7. Audit existing deployed executables for any signs of compromise in `/tmp/pkg/` directories.
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation4.0 h
- Implementation16.0 h
- Testing8.0 h
- Review / QA4.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2024-24828 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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