Skip to content

v11: Unbounded memory accumulation in remoteTarballFetcher during streaming #80

Closed
pnpm/pnpm
#16613

Description

@zkochan

Summary

In pnpm11/fetching/tarball-fetcher/src/remoteTarballFetcher.ts, chunks from the HTTP response body stream are buffered into memory without an upper limit while downloading remote tarballs.

If a malicious or misconfigured remote server returns an endless stream of data, the process accumulates buffers until Node.js process heap memory is exhausted, causing an out-of-memory crash.

Affected Components

  • pnpm11/fetching/tarball-fetcher/src/remoteTarballFetcher.ts (stream buffering)

Suggested Fix

Enforce an upper threshold on accumulated response body bytes for package tarballs, or stream directly into a bounded parser/store writer with backpressure.

Context

Originally reported in GHSA-49gx-j698-j73j by Jvr2022.

Activity

  1. zkochan commented on Oct 5, 2026

    @zkochan
    MemberAuthor

    Opened pnpm/pnpm#16613 to address this task. Spills large tarball downloads to temporary files with bounded buffering and cleanup on failure. Archive integrity is verified before extraction.


    Written by an agent (Codex, GPT-6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions