GHSA-22R3-9W55-CJ54
Vulnerability from github – Published: 2024-02-09 15:20 – Updated: 2024-02-12 15:03Impact
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.
Patches
This package is deprecated. Therefore, there will not be a patch provided for this vulnerability.
Recommended Action:
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.
Workarounds
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.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "pkg"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "5.8.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-24828"
],
"database_specific": {
"cwe_ids": [
"CWE-276"
],
"github_reviewed": true,
"github_reviewed_at": "2024-02-09T15:20:27Z",
"nvd_published_at": "2024-02-09T23:15:09Z",
"severity": "MODERATE"
},
"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\u2019s 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.",
"id": "GHSA-22r3-9w55-cj54",
"modified": "2024-02-12T15:03:11Z",
"published": "2024-02-09T15:20:27Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Pkg Local Privilege Escalation"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.