# CVE-2023-37478: pnpm tar archive parsing bypass vulnerability

Source: https://junglewise.ai/threats/cve-2023-37478-pnpm-tar-archive-parsing-bypass-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2023-08-01. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2023-37478 · Severity: low · CVSS 3.1 · Published 2023-08-01

pnpm is a Node.js package manager used by developers to install JavaScript dependencies. The vulnerability allows an attacker to craft a malicious package that appears legitimate when installed via npm but executes compromised code when installed via pnpm, enabling supply chain attacks on development environments. This occurs because pnpm incorrectly handles tar archives with duplicate files, extracting the first occurrence instead of the final one as per the TAR specification.

Technologies: [pnpm (npm)](https://junglewise.ai/threats/technologies/pnpm). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2023-37478 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2023-37478 being exploited in the wild.

**How severe is CVE-2023-37478?** Low severity, with a CVSS score of 3.1, published 1 August 2023.

**Which products and versions are affected?** @pnpm/cafs (npm) SEMVER:introduced=0,fixed=7.0.5; @pnpm/exe (npm) SEMVER:introduced=0,fixed=7.33.4; @pnpm/linux-arm64 (npm) SEMVER:introduced=0,fixed=7.33.4; @pnpm/linux-x64 (npm) SEMVER:introduced=0,fixed=7.33.4; and 5 more.

**Is there a fix for CVE-2023-37478?** Yes. @pnpm/cafs (npm): upgrade to 7.0.5 or later; @pnpm/exe (npm): upgrade to 7.33.4 or later; @pnpm/linux-arm64 (npm): upgrade to 7.33.4 or later; @pnpm/linux-x64 (npm): upgrade to 7.33.4 or later; @pnpm/linuxstatic-arm64 (npm): upgrade to 7.33.4 or later; @pnpm/macos-arm64 (npm): upgrade to 7.33.4 or later; @pnpm/macos-x64 (npm): upgrade to 7.33.4 or later; @pnpm/win-x64 (npm): upgrade to 7.33.4 or later; pnpm (npm): upgrade to 7.33.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2023-37478 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2023-37478?** Check whether you run @pnpm/cafs (npm), @pnpm/exe (npm), @pnpm/linux-arm64 (npm) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @pnpm/cafs (npm): upgrade to 7.0.5 or later

  ```sh
  npm install @pnpm/cafs@7.0.5
  ```

- @pnpm/exe (npm): upgrade to 7.33.4 or later

  ```sh
  npm install @pnpm/exe@7.33.4
  ```

- @pnpm/linux-arm64 (npm): upgrade to 7.33.4 or later

  ```sh
  npm install @pnpm/linux-arm64@7.33.4
  ```

- @pnpm/linux-x64 (npm): upgrade to 7.33.4 or later

  ```sh
  npm install @pnpm/linux-x64@7.33.4
  ```

- @pnpm/linuxstatic-arm64 (npm): upgrade to 7.33.4 or later

  ```sh
  npm install @pnpm/linuxstatic-arm64@7.33.4
  ```

- @pnpm/macos-arm64 (npm): upgrade to 7.33.4 or later

  ```sh
  npm install @pnpm/macos-arm64@7.33.4
  ```

- @pnpm/macos-x64 (npm): upgrade to 7.33.4 or later

  ```sh
  npm install @pnpm/macos-x64@7.33.4
  ```

- @pnpm/win-x64 (npm): upgrade to 7.33.4 or later

  ```sh
  npm install @pnpm/win-x64@7.33.4
  ```

- pnpm (npm): upgrade to 7.33.4 or later

  ```sh
  npm install pnpm@7.33.4
  ```


## Technical details

The vulnerability stems from pnpm's tar-stream extraction logic not conforming to TAR format specification. The TAR format is append-only; when a file appears multiple times, the last occurrence should be extracted. pnpm instead uses the first occurrence, allowing attackers to create tarballs with multiple root directories (e.g., a/, package/, z/) each containing different package.json files. After stripping the first path component (standard practice), the payload depends on extraction order: npm uses the last file (spec-compliant), while pnpm uses the first. This enables supply chain attacks where a package passes registry inspection but executes malicious dependencies when installed via pnpm. The issue affects pnpm versions before 7.33.4 and 8.0.0–8.6.7. Patches are available in v7.33.4 and v8.6.8.

## Affected products

- pnpm pnpm <7.33.4 or >=8.0.0 <8.6.8
- pnpm @pnpm/cafs <7.0.5
- pnpm @pnpm/exe <7.33.4 or >=8.0.0 <8.6.8
- pnpm @pnpm/linux-arm64 <7.33.4 or >=8.0.0 <8.6.8
- pnpm @pnpm/linux-x64 <7.33.4 or >=8.0.0 <8.6.8
- pnpm @pnpm/linuxstatic-arm64 <7.33.4 or >=8.0.0 <8.6.8
- pnpm @pnpm/macos-arm64 <7.33.4 or >=8.0.0 <8.6.8
- pnpm @pnpm/macos-x64 <7.33.4 or >=8.0.0 <8.6.8
- pnpm @pnpm/win-x64 <7.33.4 or >=8.0.0 <8.6.8

## Identifiers

- CVE-2023-37478
- GHSA-5r98-f33j-g8h7

## Timeline

- 2023-08-01: disclosed: Vulnerability disclosed via GHSA-5r98-f33j-g8h7
- 2023-07-17: patched: Patches released in v7.33.4 and v8.6.8

## References

- [https://github.com/pnpm/pnpm/security/advisories/GHSA-5r98-f33j-g8h7](https://github.com/pnpm/pnpm/security/advisories/GHSA-5r98-f33j-g8h7)
- [https://github.com/pnpm/pnpm](https://github.com/pnpm/pnpm)
- [https://github.com/pnpm/pnpm/releases/tag/v7.33.4](https://github.com/pnpm/pnpm/releases/tag/v7.33.4)
- [https://github.com/pnpm/pnpm/releases/tag/v8.6.8](https://github.com/pnpm/pnpm/releases/tag/v8.6.8)

## Related threats

- [pnpm environment secret exfiltration via proxy settings in workspace manifest](https://junglewise.ai/threats/pnpm-environment-secret-exfiltration-via-proxy-settings-in-workspace-f6626cca)
- [pnpm pacquet path traversal in lockfile dependency symlinks](https://junglewise.ai/threats/pnpm-pacquet-path-traversal-in-lockfile-dependency-symlinks-dc3f81d1)
- [pnpm tarball dependency manifest name path traversal arbitrary file write](https://junglewise.ai/threats/cve-2026-82393-pnpm-tarball-dependency-manifest-name-path-traversal-arbitrary)
- [pnpm virtual store linker path traversal via unvalidated depPath](https://junglewise.ai/threats/cve-2026-82392-pnpm-virtual-store-linker-path-traversal-via-unvalidated-deppath)
- [pnpm path traversal via crafted lockfile alias](https://junglewise.ai/threats/cve-2026-59196-pnpm-path-traversal-via-crafted-lockfile-alias)
