CVE-2024-47829: Pnpm Pnpm Uses The Md5 Path Vulnerability
MODERATECVE-2024-47829 is a MODERATE (CVSS 6.5) pnpm uses the md5 path vulnerability (CWE-328: Use of Weak Hash) affecting Pnpm libraries in the npm ecosystem. The issue involves pnpm uses the md5 path shortening function causes packet paths to coincide, which causes indirect packet overwriting. Remediation is available by upgrading affected packages to version 10.0.0.
CVE-2024-47829 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L).
How to Fix CVE-2024-47829
To remediate this vulnerability, upgrade all affected Pnpm 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 pnpm@10.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls pnpm
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-47829, inspect your project dependencies using npm:
npm ls pnpm
Analyze the terminal output to locate any version of Pnpm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.0.0), your application is affected.
Note: The npm ls pnpm 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-328: Use of Weak Hash, where the product uses an algorithm that produces a digest (output value) that does not meet security expectations for a hash function that allows an adversary to reasonably determine the original input (preimage attack), find another input that can produce the same hash (2nd preimage attack), or find multiple inputs that evaluate to the same hash (birthday attack). In Pnpm, 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-47829 Affected Pnpm Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pnpm
|
npm |
< 10.0.0
|
10.0.0
|
References
Frequently Asked Questions
What is CVE-2024-47829?
Which Pnpm versions are affected?
What version fixes CVE-2024-47829?
Is pnpm affected?
What is the CVSS score of CVE-2024-47829?
What CWE is associated with CVE-2024-47829?
How can I check npm dependencies for CVE-2024-47829?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8cc4-rfj6-fhg4",
"modified" : "2025-04-23T19:15:59Z",
"published" : "2025-04-23T14:05:47Z",
"aliases" : [ "CVE-2024-47829" ],
"summary" : "pnpm uses the md5 path shortening function causes packet paths to coincide, which causes indirect packet overwriting",
"details" : "The path shortening function is used in pnpm:\n```\nexport function depPathToFilename (depPath: string, maxLengthWithoutHash: number): string {\n let filename = depPathToFilenameUnescaped(depPath).replace(/[\\\\/:*?\"<>|]/g, '+')\n if (filename.includes('(')) {\n filename = filename\n .replace(/\\)$/, '')\n .replace(/(\\)\\()|\\(|\\)/g, '_')\n }\n if (filename.length > maxLengthWithoutHash || filename !== filename.toLowerCase() && !filename.startsWith('file+')) {\n return `${filename.substring(0, maxLengthWithoutHash - 27)}_${createBase32Hash(filename)}`\n }\n return filename\n}\n```\nHowever, it uses the md5 function as a path shortening compression function, and if a collision occurs, it will result in the same storage path for two different libraries. Although the real names are under the package name /node_modoules/, there are no version numbers for the libraries they refer to.\n\nIn the diagram, we assume that two packages are called packageA and packageB, and that the first 90 digits of their package names must be the same, and that the hash value of the package names with versions must be the same. Then C is the package that they both reference, but with a different version number. (npm allows package names up to 214 bytes, so constructing such a collision package name is obvious.)\n\nThen hash(packageA@1.2.3)=hash(packageB@3.4.5). This results in the same path for the installation, and thus under the same directory. Although the package names under node_modoules are the full paths again, they are shared with C.\nWhat is the exact version number of C?\nIn our local tests, it depends on which one is installed later. If packageB is installed later, the C version number will change to 2.0.0. At this time, although package A requires the C@1.0.0 version, package. json will only work during installation, and will not affect the actual operation.\nWe did not receive any installation error issues from pnpm during our local testing, nor did we use force, which is clearly a case that can be triggered.\n\nFor a package with a package name + version number longer than 120, another package can be constructed to introduce an indirect reference to a lower version, such as one with some known vulnerability.\nAlternatively, it is possible to construct two packages with more than 120 package names + version numbers.\nThis is clearly an advantage for those intent on carrying out supply chain attacks.\n\n\nThe solution:\nThe repair cost is also very low, just need to upgrade the md5 function to sha256.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "pnpm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "10.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pnpm/pnpm/security/advisories/GHSA-8cc4-rfj6-fhg4"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-47829"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pnpm/pnpm"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-328" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-04-23T14:05:47Z",
"nvd_published_at" : "2025-04-23T16:15:29Z"
}
}