paperclipai/paperclip · error

Kubernetes syncOut refusing tarball link whose target escape

Error message

Kubernetes syncOut refusing tarball link whose target escapes the extraction dir: ${name} -> ${linkTarget}

What it means

Error "Kubernetes syncOut refusing tarball link whose target escapes the extraction dir: ${name} -> ${linkTarget}" thrown in paperclipai/paperclip.

Source

Thrown at packages/plugins/sandbox-providers/kubernetes/src/file-sync.ts:404

    if (typeFlag === "l") {
      const split = splitLinkEntryOnce(name, " -> ");
      if (!split) throw new Error(`Kubernetes syncOut refusing unparseable or ambiguous symlink entry: ${line}`);
      name = split.name;
      linkTarget = split.target;
    } else if (typeFlag === "h") {
      const split = splitLinkEntryOnce(name, " link to ");
      if (!split) throw new Error(`Kubernetes syncOut refusing unparseable or ambiguous hardlink entry: ${line}`);
      name = split.name;
      linkTarget = split.target;
    }
    const cleanName = name.replace(/\/+$/, "");
    if (cleanName.length > 0 && posixPathEscapes(cleanName)) {
      throw new Error(`Kubernetes syncOut refusing tarball member that escapes the extraction dir: ${name}`);
    }
    if (linkTarget !== null) {
      const resolved = path.posix.join(path.posix.dirname(cleanName), linkTarget);
      if (path.posix.isAbsolute(linkTarget) || posixPathEscapes(resolved)) {
        throw new Error(
          `Kubernetes syncOut refusing tarball link whose target escapes the extraction dir: ${name} -> ${linkTarget}`,
        );
      }
    }
  }
}

async function extractHostTarball(input: { archivePath: string; localDir: string }): Promise<void> {
  // The archive is sandbox-authored and untrusted: validate every member (and
  // link target) is confined before letting host-side tar write a single byte.
  await assertTarballEntriesConfined(input.archivePath);
  await fs.mkdir(input.localDir, { recursive: true });
  await execFileAsync("tar", ["-xf", input.archivePath, "-C", input.localDir], {
    env: { ...process.env, COPYFILE_DISABLE: "1" },
    maxBuffer: 64 * 1024 * 1024,
  });
}

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Fix the link so its target stays inside the extraction directory.

When it happens

Trigger: Thrown at packages/plugins/sandbox-providers/kubernetes/src/file-sync.ts:404 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/5a9d62ea4743be52. Report an issue: GitHub.