CVE-2023-37478
pnpm incorrectly parses tar archives relative to specification
pnpm is a package manager. It 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. This 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. This issue has been patched in version(s) 7.33.4 and 8.6.8.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.5
pnpm incorrectly parses tar archives relative to specification
pnpm is a package manager. It 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. This 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. This issue has been patched in version(s) 7.33.4 and 8.6.8.
- Record
CVE-2023-37478- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-284
- Updated
- 2026-11-02
EUVDEUVD-2023-2219
7.5
pnpm is a package manager. It 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. This 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. This issue has been patched in version(s) 7.33.4 and 8.6.8.
- Record
EUVD-2023-2219- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-5r98-f33j-g8h7
7.5
pnpm incorrectly parses tar archives relative to specification
Summary
It 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.
Details
The 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.
This 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.
When 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.
PoC
Create a root folder with the following layout:
a/package.jsonpackage/package.jsonz/package.json
File contents:
a/package.json
{
"name": "test-package",
"version": "0.1.0",
"description": "This is a bad version of a test package",
"dependencies": {
"react": "^15"
}
}
package/package.json
{
"name": "test-package",
"version": "0.1.0",
"description": "This is a bad version of a test package",
"dependencies": {
"react": "^16"
}
}
z/package.json
{
"name": "test-package",
"version": "0.1.0",
"description": "This is the good version of a test package",
"dependencies": {
"react": "^17"
}
}
Then use the tar binary to produce a tarball (working directory is the root folder):
tar -c -z --format ustar -f package.tgz a package z
The 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.
Install the tarball via the file: protocol.
Observe that with npm, the lockfile has react@17, while with pnpm it has react@15.
Impact
This 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.
- Record
GHSA-5r98-f33j-g8h7- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-284
- Updated
- 2026-11-02
NVD
7.5
pnpm is a package manager. It 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. This 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. This issue has been patched in version(s) 7.33.4 and 8.6.8.
- Record
CVE-2023-37478- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H - CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-284
- Updated
- 2026-11-02
OSV
7.5
pnpm incorrectly parses tar archives relative to specification
pnpm is a package manager. It 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. This 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. This issue has been patched in version(s) 7.33.4 and 8.6.8.
- Record
CVE-2023-37478- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-284
- Updated
- 2026-11-02
OSVGHSA-5r98-f33j-g8h7
7.5
pnpm incorrectly parses tar archives relative to specification
Summary
It 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.
Details
The 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.
This 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.
When 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.
PoC
Create a root folder with the following layout:
a/package.jsonpackage/package.jsonz/package.json
File contents:
a/package.json
{
"name": "test-package",
"version": "0.1.0",
"description": "This is a bad version of a test package",
"dependencies": {
"react": "^15"
}
}
package/package.json
{
"name": "test-package",
"version": "0.1.0",
"description": "This is a bad version of a test package",
"dependencies": {
"react": "^16"
}
}
z/package.json
{
"name": "test-package",
"version": "0.1.0",
"description": "This is the good version of a test package",
"dependencies": {
"react": "^17"
}
}
Then use the tar binary to produce a tarball (working directory is the root folder):
tar -c -z --format ustar -f package.tgz a package z
The 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.
Install the tarball via the file: protocol.
Observe that with npm, the lockfile has react@17, while with pnpm it has react@15.
Impact
This 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.
- Record
GHSA-5r98-f33j-g8h7- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-284
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
pnpmnpm |
before 7.33.4 | 7.33.4 |
@pnpm/exenpm |
before 7.33.4 | 7.33.4 |
@pnpm/linux-arm64npm |
before 7.33.4 | 7.33.4 |
@pnpm/linux-x64npm |
before 7.33.4 | 7.33.4 |
@pnpm/linuxstatic-arm64npm |
before 7.33.4 | 7.33.4 |
@pnpm/macos-arm64npm |
before 7.33.4 | 7.33.4 |
@pnpm/macos-x64npm |
before 7.33.4 | 7.33.4 |
@pnpm/win-x64npm |
before 7.33.4 | 7.33.4 |
@pnpm/cafsnpm |
before 7.0.5 | 7.0.5 |
pnpmnpm |
8.0.0 up to 8.6.8 | 8.6.8 |
Show 7 moreShow less
| Package | Affected | Fixed |
|---|---|---|
@pnpm/exenpm |
8.0.0 up to 8.6.8 | 8.6.8 |
@pnpm/linux-arm64npm |
8.0.0 up to 8.6.8 | 8.6.8 |
@pnpm/linux-x64npm |
8.0.0 up to 8.6.8 | 8.6.8 |
@pnpm/linuxstatic-arm64npm |
8.0.0 up to 8.6.8 | 8.6.8 |
@pnpm/macos-arm64npm |
8.0.0 up to 8.6.8 | 8.6.8 |
@pnpm/macos-x64npm |
8.0.0 up to 8.6.8 | 8.6.8 |
@pnpm/win-x64npm |
8.0.0 up to 8.6.8 | 8.6.8 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | TrevorGKann/CVE-2023-37478_npm_vs_pnpm | 2023-10-24 |
| PoC in GitHub | li-minhao/CVE-2023-37478-Demo | 2023-11-03 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-37478 is a high vulnerability (CVSS 7.5) in Pnpm, published August 1, 2023. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 1.20%, the 68th percentile. Fixed in pnpm 7.33.4.
References
github.com/pnpm/pnpm/security/advisories/GHSA-5r98-f33j-g8h7
github.com/pnpm/pnpm/releases/tag/v7.33.4
github.com/pnpm/pnpm/releases/tag/v8.6.8
nvd.nist.gov/vuln/detail/CVE-2023-37478
github.com/advisories/GHSA-5r98-f33j-g8h7
github.com/CVEProject/cvelistV5/tree/main/cves/2023/37xxx/CVE-2023-37478.json
github.com/pnpm/pnpm