Skip to content

v11: pnpm deploy --deploy-all-files dereferences symlinks outside workspace root #98

Closed
pnpm/pnpm
#16613

Description

@zkochan

Summary

When pnpm deploy is executed with the deploy-all-files config option enabled, pnpm11/fetching/directory-fetcher/src/index.ts walks the workspace directory using fs.stat() and fs.readdir().

Both functions follow symlinks without verifying path containment. Any symlink committed in the workspace is dereferenced and copied into the deploy output directory, potentially leaking external local files into deployment bundles.

Affected Components

  • pnpm11/fetching/directory-fetcher/src/index.ts (lines 78-106)
  • pnpm11/fs/indexed-pkg-importer/src/importIndexedDir.ts

Suggested Fix

Use fs.lstat during directory traversal and verify that symlink targets resolve within the workspace root before copying.

Context

Originally reported in GHSA-jqc3-j2x5-qf7h by j4xT.

Activity

  1. zkochan commented on Oct 5, 2026

    @zkochan
    MemberAuthor

    Opened pnpm/pnpm#16613 to address this task. Checks symlink targets against the workspace root when collecting all deployment files, preventing external files from entering the deployment output.


    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