[security] Prevent shadowing stdlib in gzip/tarfile/zipfile CLI [CVE-2026-115791]

オープン
#161,705 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
15/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
cli, security

調査の方向性

The problem sits in the command-line entry points of the gzip, tarfile and zipfile modules, where archives are extracted into the current directory while python -m puts that directory on sys.path. Read those __main__ paths and the extraction error handling, then reproduce with an archive containing a traceback.py that fails on a later member. Work is already underway in the linked PRs (gh-161706 and others), so review those before starting; done means the stdlib cannot be shadowed during CLI extraction.

索引モデルが issue の本文から書いたものです。

説明

3.11 3.12 3.13 3.14 3.15 3.16 stdlib type-security

When tarfile or zipfile command line interface (CLI) is used to decompress an archive, a Python script shadowing the stdlib can be created. Then if an error occurs during decompressing the next file, the newly created Python script is executed. This is especially true if the created Python is called traceback.py. The problem is that Python adds the current directory to sys.path when python -m MODULE is run, and the archive is also decompressed in the current directory.

Linked PRs
  • gh-161706
  • gh-161717
  • gh-161719
  • gh-161726
  • gh-161727
  • gh-161728
主要言語
Python
スター
78.2k
フォーク
36.6k
平均マージ
19時間 57分
マージ済み PR(30日)
630

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python/cpython のほかの issue

python/cpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。