Vulnerabilities in pkg:npm/pkg
PACKAGECVE-2024-24828 is a MODERATE (CVSS 6.6) pkg local privilege escalation vulnerability (CWE-276: Incorrect Default Permissions) affecting Pkg libraries in the npm ecosystem. The issue involves pkg local privilege escalation. Remediation is available in the latest vendor maintenance releases.
pkg:npm/pkg
Vulnerability advisories affecting package pkg:npm/pkg. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-22r3-9w55-cj54 | CVE-2024-24828 | MODERATE | Pkg Local Privilege Escalation |
CVE-2024-24828 at a Glance
Security Impact
CVSS: 6.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N).
How to Fix CVE-2024-24828
To remediate this vulnerability, upgrade all affected Pkg dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install pkg@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls pkg
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-24828, inspect your project dependencies using npm:
npm ls pkg
Analyze the terminal output to locate any version of Pkg in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The npm ls pkg command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In Pkg, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-24828 Affected Pkg Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pkg
|
npm |
≤ 5.8.1
|
|
References
Frequently Asked Questions
What is CVE-2024-24828?
Which Pkg versions are affected?
What version fixes CVE-2024-24828?
Is pkg affected?
What is the CVSS score of CVE-2024-24828?
What CWE is associated with CVE-2024-24828?
How can I check npm dependencies for CVE-2024-24828?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-22r3-9w55-cj54",
"modified" : "2024-02-12T15:03:11Z",
"published" : "2024-02-09T15:20:27Z",
"aliases" : [ "CVE-2024-24828" ],
"summary" : "Pkg Local Privilege Escalation",
"details" : "### Impact\nAny 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.\n\nAn 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.\n\n### Patches\nThis package is deprecated. Therefore, there will not be a patch provided for this vulnerability.\n\n### Recommended Action:\nTo check if your executable build by pkg depends on native code and is vulnerable, run the executable and check if `/tmp/pkg/` was created.\n\nUsers should transition to actively maintained alternatives. We would recommend investigating Node.js 21’s support for [single executable applications](https://nodejs.org/api/single-executable-applications.html).\n\n### Workarounds\nGiven 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "pkg"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "5.8.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/vercel/pkg/security/advisories/GHSA-22r3-9w55-cj54"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-24828"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/vercel/pkg"
}, {
"type" : "WEB",
"url" : "https://nodejs.org/api/single-executable-applications.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-276" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-02-09T15:20:27Z",
"nvd_published_at" : "2024-02-09T23:15:09Z"
}
}