python / python/cpython

tarfile hardlink fallback ignores custom extraction filter rejection via None

Open
#157,265 0 comments 0 reactions 1 assignee View on GitHub

@encukou is already working on this.

Since Sep 10, 2026.

3.10 3.11 3.12 3.13 3.14 3.15 3.16 stdlib type-security
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

When tarfile extracts a link on a system that doesn't support links, it falls back to extracting a member from the archive. In this case, the filter function is run twice: once for the extracted member, and once with name set to the location of the link.
For one of the calls, the return value is ignored. Instead, the member should be skipped if either call returns None.

Linked PRs
  • gh-157266
  • gh-157304
  • gh-157305
  • gh-157306
  • gh-157307
  • gh-157308
  • gh-157309
  • gh-157334

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.