Vulnerabilities in pkg:npm/@pnpm/win-x64
PACKAGECVE-2023-37478 is a HIGH (CVSS 7.5) pnpm incorrectly parses tar archives vulnerability (CWE-284: Improper Access Control) affecting @pnpm/macos arm64 libraries in the npm ecosystem. The issue involves pnpm incorrectly parses tar archives relative to specification. Remediation is available by upgrading affected packages to version 7.33.4, 7.0.5, 8.6.8.
pkg:npm/@pnpm/win-x64
Vulnerability advisories affecting package pkg:npm/@pnpm/win-x64. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-5r98-f33j-g8h7 | CVE-2023-37478 | HIGH | pnpm incorrectly parses tar archives relative to specification |
CVE-2023-37478 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2023-37478
To remediate this vulnerability, upgrade all affected @pnpm/macos arm64 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/macos-arm64@7.33.4
npm install @pnpm/linux-arm64@7.33.4
npm install @pnpm/linux-x64@7.33.4
npm install @pnpm/linuxstatic-arm64@7.33.4
npm install @pnpm/macos-x64@7.33.4
npm install @pnpm/win-x64@7.33.4
npm install @pnpm/cafs@7.0.5
npm install pnpm@8.6.8
npm install @pnpm/exe@8.6.8
npm install @pnpm/linux-arm64@8.6.8
npm install @pnpm/linux-x64@8.6.8
npm install @pnpm/linuxstatic-arm64@8.6.8
npm install @pnpm/macos-arm64@8.6.8
npm install @pnpm/macos-x64@8.6.8
npm install @pnpm/win-x64@8.6.8
npm install pnpm@7.33.4
npm install @pnpm/exe@7.33.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @pnpm/macos-arm64
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-37478, inspect your project dependencies using npm:
npm ls @pnpm/macos-arm64
Analyze the terminal output to locate any version of @pnpm/macos arm64 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.33.4), your application is affected.
Note: The npm ls @pnpm/macos-arm64 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In @pnpm/macos arm64, 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-2023-37478 Affected @pnpm/macos arm64 Versions
17 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@pnpm/macos-arm64
|
npm |
< 7.33.4
|
7.33.4
|
|
@pnpm/linux-arm64
|
npm |
< 7.33.4
|
7.33.4
|
|
@pnpm/linux-x64
|
npm |
< 7.33.4
|
7.33.4
|
|
@pnpm/linuxstatic-arm64
|
npm |
< 7.33.4
|
7.33.4
|
|
@pnpm/macos-x64
|
npm |
< 7.33.4
|
7.33.4
|
|
@pnpm/win-x64
|
npm |
< 7.33.4
|
7.33.4
|
|
@pnpm/cafs
|
npm |
< 7.0.5
|
7.0.5
|
|
pnpm
|
npm |
≥ 8.0.0
< 8.6.8
|
8.6.8
|
|
@pnpm/exe
|
npm |
≥ 8.0.0
< 8.6.8
|
8.6.8
|
|
@pnpm/linux-arm64
|
npm |
≥ 8.0.0
< 8.6.8
|
8.6.8
|
|
@pnpm/linux-x64
|
npm |
≥ 8.0.0
< 8.6.8
|
8.6.8
|
|
@pnpm/linuxstatic-arm64
|
npm |
≥ 8.0.0
< 8.6.8
|
8.6.8
|
|
@pnpm/macos-arm64
|
npm |
≥ 8.0.0
< 8.6.8
|
8.6.8
|
|
@pnpm/macos-x64
|
npm |
≥ 8.0.0
< 8.6.8
|
8.6.8
|
|
@pnpm/win-x64
|
npm |
≥ 8.0.0
< 8.6.8
|
8.6.8
|
|
pnpm
|
npm |
< 7.33.4
|
7.33.4
|
|
@pnpm/exe
|
npm |
< 7.33.4
|
7.33.4
|
References
Frequently Asked Questions
What is CVE-2023-37478?
Which @pnpm/macos arm64 versions are affected?
What version fixes CVE-2023-37478?
Is @pnpm/macos-arm64 affected?
Is @pnpm/linux-arm64 affected?
What is the CVSS score of CVE-2023-37478?
What CWE is associated with CVE-2023-37478?
How can I check npm dependencies for CVE-2023-37478?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5r98-f33j-g8h7",
"modified" : "2023-08-01T17:00:55Z",
"published" : "2023-08-01T17:00:55Z",
"aliases" : [ "CVE-2023-37478" ],
"summary" : "pnpm incorrectly parses tar archives relative to specification",
"details" : "### Summary\nIt is possible to construct a tarball that, when installed via npm or parsed by the registry is safe, but when installed via pnpm is malicious, due to how pnpm parses tar archives.\n\n### Details\nThe TAR format is an append-only archive format, and as such, the specification for how to update a file is to add a new record to the end with the updated version of the file. This means that it is completely valid for an archive to contain multiple copies of, say, `package.json`, and the expected behavior when extracting is that all versions other than the last get ignored.\n\nThis is further complicated by that during tarball extraction, all package managers are configured to drop the first path component, so collisions can be created simply by using multiple root folders in the archive, even without performing updates.\n\nWhen pnpm extracts a tar archive via tar-stream, it appears to extract only the _first_ file of a given name and discards all subsequent files with the same name.\n\n### PoC\nCreate a root folder with the following layout:\n- `a/package.json`\n- `package/package.json`\n- `z/package.json`\n\nFile contents:\n#### a/package.json\n```json\n{\n \"name\": \"test-package\",\n \"version\": \"0.1.0\",\n \"description\": \"This is a bad version of a test package\",\n \"dependencies\": {\n \"react\": \"^15\"\n }\n}\n```\n#### package/package.json\n```json\n{\n \"name\": \"test-package\",\n \"version\": \"0.1.0\",\n \"description\": \"This is a bad version of a test package\",\n \"dependencies\": {\n \"react\": \"^16\"\n }\n}\n```\n#### z/package.json\n```json\n{\n \"name\": \"test-package\",\n \"version\": \"0.1.0\",\n \"description\": \"This is the good version of a test package\",\n \"dependencies\": {\n \"react\": \"^17\"\n }\n}\n```\n\nThen use the tar binary to produce a tarball (working directory is the root folder):\n`tar -c -z --format ustar -f package.tgz a package z`\nThe order of the folders at the end matters; whichever one is last will end up being the package.json that wins when extracted by npm; the one that is first will be the one that wins when extracted by pnpm.\n\nInstall the tarball via the `file:` protocol.\n\nObserve that with npm, the lockfile has `react@17`, while with pnpm it has `react@15`.\n\n### Impact\nThis can result in a package that appears safe on the npm registry or when installed via npm being replaced with a compromised or malicious version when installed via pnpm.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "pnpm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.33.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/exe"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.33.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/linux-arm64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.33.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/linux-x64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.33.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/linuxstatic-arm64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.33.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/macos-arm64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.33.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/macos-x64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.33.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/win-x64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.33.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/cafs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.0.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "pnpm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.6.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/exe"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.6.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/linux-arm64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.6.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/linux-x64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.6.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/linuxstatic-arm64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.6.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/macos-arm64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.6.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/macos-x64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.6.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@pnpm/win-x64"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.6.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pnpm/pnpm/security/advisories/GHSA-5r98-f33j-g8h7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-37478"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pnpm/pnpm"
}, {
"type" : "WEB",
"url" : "https://github.com/pnpm/pnpm/releases/tag/v7.33.4"
}, {
"type" : "WEB",
"url" : "https://github.com/pnpm/pnpm/releases/tag/v8.6.8"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-284" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-01T17:00:55Z",
"nvd_published_at" : "2023-08-01T12:15:09Z"
}
}