Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS0yMnIzLTl3NTUtY2o1NM4AA5Lq

Pkg Local Privilege Escalation

Impact

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.

Permalink: https://github.com/advisories/GHSA-22r3-9w55-cj54
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0yMnIzLTl3NTUtY2o1NM4AA5Lq
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 3 months ago
Updated: 3 months ago


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

Identifiers: GHSA-22r3-9w55-cj54, CVE-2024-24828
References: Repository: https://github.com/vercel/pkg
Blast Radius: 26.2

Affected Packages

npm:pkg
Dependent packages: 1,809
Dependent repositories: 9,444
Downloads: 737,126 last month
Affected Version Ranges: <= 5.8.1
No known fixed version
All affected versions: 0.0.0, 0.0.1, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 4.0.0, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.2.0, 4.2.1, 4.2.2, 4.2.3, 4.2.4, 4.2.5, 4.2.6, 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.3.4, 4.3.5, 4.3.6, 4.3.7, 4.3.8, 4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.4.4, 4.4.5, 4.4.6, 4.4.7, 4.4.8, 4.4.9, 4.5.0, 4.5.1, 5.0.0, 5.1.0, 5.2.0, 5.2.1, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.4.0, 5.4.1, 5.5.0, 5.5.1, 5.5.2, 5.6.0, 5.7.0, 5.8.0, 5.8.1