CVE-2023-37478 is a high-severity security vulnerability in pnpm (npm), affecting versions < 7.33.4. It is fixed in 7.33.4, 7.0.5, 8.6.8.
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.json package/package.json z/package.json File contents: a/package.json package/package.json z/package.json 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.
CVE-2023-37478 has a CVSS score of 7.5 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.
A fixed version is available (7.33.4, 7.0.5, 8.6.8). Upgrading removes the vulnerable code path.
npm
pnpm (< 7.33.4)@pnpm/exe (< 7.33.4)@pnpm/linux-arm64 (< 7.33.4)@pnpm/linux-x64 (< 7.33.4)@pnpm/linuxstatic-arm64 (< 7.33.4)@pnpm/macos-arm64 (< 7.33.4)@pnpm/macos-x64 (< 7.33.4)@pnpm/win-x64 (< 7.33.4)@pnpm/cafs (< 7.0.5)pnpm (>= 8.0.0, < 8.6.8)@pnpm/exe (>= 8.0.0, < 8.6.8)@pnpm/linux-arm64 (>= 8.0.0, < 8.6.8)@pnpm/linux-x64 (>= 8.0.0, < 8.6.8)@pnpm/linuxstatic-arm64 (>= 8.0.0, < 8.6.8)@pnpm/macos-arm64 (>= 8.0.0, < 8.6.8)@pnpm/macos-x64 (>= 8.0.0, < 8.6.8)@pnpm/win-x64 (>= 8.0.0, < 8.6.8)pnpm → 7.33.4 (npm)@pnpm/exe → 7.33.4 (npm)@pnpm/linux-arm64 → 7.33.4 (npm)@pnpm/linux-x64 → 7.33.4 (npm)@pnpm/linuxstatic-arm64 → 7.33.4 (npm)@pnpm/macos-arm64 → 7.33.4 (npm)@pnpm/macos-x64 → 7.33.4 (npm)@pnpm/win-x64 → 7.33.4 (npm)@pnpm/cafs → 7.0.5 (npm)pnpm → 8.6.8 (npm)@pnpm/exe → 8.6.8 (npm)@pnpm/linux-arm64 → 8.6.8 (npm)@pnpm/linux-x64 → 8.6.8 (npm)@pnpm/linuxstatic-arm64 → 8.6.8 (npm)@pnpm/macos-arm64 → 8.6.8 (npm)@pnpm/macos-x64 → 8.6.8 (npm)@pnpm/win-x64 → 8.6.8 (npm)Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.
Kodem's runtime-powered SCA identifies whether CVE-2023-37478 is reachable in your applications. Explore open-source security for your team.
See if CVE-2023-37478 is reachable in your applications. Get a demo
Already deployed Kodem? See CVE-2023-37478 in your environment →Upgrade the following packages to resolve this vulnerability:
pnpm to 7.33.4 or later@pnpm/exe to 7.33.4 or later@pnpm/linux-arm64 to 7.33.4 or later@pnpm/linux-x64 to 7.33.4 or later@pnpm/linuxstatic-arm64 to 7.33.4 or later@pnpm/macos-arm64 to 7.33.4 or later@pnpm/macos-x64 to 7.33.4 or later@pnpm/win-x64 to 7.33.4 or later@pnpm/cafs to 7.0.5 or laterpnpm to 8.6.8 or later@pnpm/exe to 8.6.8 or later@pnpm/linux-arm64 to 8.6.8 or later@pnpm/linux-x64 to 8.6.8 or later@pnpm/linuxstatic-arm64 to 8.6.8 or later@pnpm/macos-arm64 to 8.6.8 or later@pnpm/macos-x64 to 8.6.8 or later@pnpm/win-x64 to 8.6.8 or laterKodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
CVE-2023-37478 is a high-severity security vulnerability in pnpm (npm), affecting versions < 7.33.4. It is fixed in 7.33.4, 7.0.5, 8.6.8.
CVE-2023-37478 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
pnpm (npm) (versions < 7.33.4)@pnpm/exe (npm) (versions < 7.33.4)@pnpm/linux-arm64 (npm) (versions < 7.33.4)@pnpm/linux-x64 (npm) (versions < 7.33.4)@pnpm/linuxstatic-arm64 (npm) (versions < 7.33.4)@pnpm/macos-arm64 (npm) (versions < 7.33.4)@pnpm/macos-x64 (npm) (versions < 7.33.4)@pnpm/win-x64 (npm) (versions < 7.33.4)@pnpm/cafs (npm) (versions < 7.0.5)Yes. CVE-2023-37478 is fixed in 7.33.4, 7.0.5, 8.6.8. Upgrade to this version or later.
Whether CVE-2023-37478 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
pnpm to 7.33.4 or later@pnpm/exe to 7.33.4 or later@pnpm/linux-arm64 to 7.33.4 or later@pnpm/linux-x64 to 7.33.4 or later@pnpm/linuxstatic-arm64 to 7.33.4 or later@pnpm/macos-arm64 to 7.33.4 or later@pnpm/macos-x64 to 7.33.4 or later@pnpm/win-x64 to 7.33.4 or later@pnpm/cafs to 7.0.5 or laterpnpm to 8.6.8 or later@pnpm/exe to 8.6.8 or later@pnpm/linux-arm64 to 8.6.8 or later@pnpm/linux-x64 to 8.6.8 or later@pnpm/linuxstatic-arm64 to 8.6.8 or later@pnpm/macos-arm64 to 8.6.8 or later@pnpm/macos-x64 to 8.6.8 or later@pnpm/win-x64 to 8.6.8 or later