Skip to content

gh-161323: Refuse drive-relative paths in tarfile extraction filters - #161334

Merged
gpshead merged 5 commits into
python:mainfrom
gpshead:scanfix-tarfile-rsl1f4at
Nov 4, 2026
Merged

gpshead merged 5 commits into
python:mainfrom
gpshead:scanfix-tarfile-rsl1f4at

Conversation

@gpshead

@gpshead gpshead commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

On Windows, os.path.join() does not put a name such as 'C:foo' below a destination that has no drive, so the 'tar' and 'data' filters now refuse names and link targets with a drive, after normalization.

gpshead and others added 3 commits November 4, 2026 17:26
…lters

On Windows, os.path.join() does not put a name such as 'C:foo' below a
destination that has no drive, so the 'tar' and 'data' filters now refuse
names and link targets with a drive, after normalization.

ANT-2026-RSL1F4AT
Co-authored-by: Petr Viktorin <encukou@gmail.com>
@read-the-docs-community

read-the-docs-community Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35651939 | 📁 Comparing 36366e4 against main (1dd8e71)

  🔍 Preview build  

2 files changed
± library/tarfile.html
± whatsnew/changelog.html

@gpshead
gpshead merged commit e4c751b into python:main Nov 4, 2026
56 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12, 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@gpshead
gpshead deleted the scanfix-tarfile-rsl1f4at branch November 4, 2026 21:24
@bedevere-app

bedevere-app Bot commented Nov 4, 2026

Copy link
Copy Markdown

GH-161355 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 4, 2026
@bedevere-app

bedevere-app Bot commented Nov 4, 2026

Copy link
Copy Markdown

GH-161356 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 4, 2026
@bedevere-app

bedevere-app Bot commented Nov 4, 2026

Copy link
Copy Markdown

GH-161357 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Nov 4, 2026
@bedevere-app

bedevere-app Bot commented Nov 4, 2026

Copy link
Copy Markdown

GH-161358 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Nov 4, 2026
@bedevere-app

bedevere-app Bot commented Nov 4, 2026

Copy link
Copy Markdown

GH-161359 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.11 only security fixes label Nov 4, 2026
gpshead added a commit that referenced this pull request Nov 4, 2026
…ilters (GH-161334) (#161356)

gh-161323: Refuse drive-relative paths in tarfile extraction filters (GH-161334)

* gh-161323: Refuse drive-relative paths in tarfile extraction filters

On Windows, os.path.join() does not put a name such as 'C:foo' below a
destination that has no drive, so the 'tar' and 'data' filters now refuse
names and link targets with a drive, after normalization.
Fixes CVE-2026-107784.

reported by Girish Konda

ANT-2026-RSL1F4AT
(cherry picked from commit e4c751b)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gpshead added a commit that referenced this pull request Nov 4, 2026
…ilters (GH-161334) (#161355)

gh-161323: Refuse drive-relative paths in tarfile extraction filters (GH-161334)

* gh-161323: Refuse drive-relative paths in tarfile extraction filters

On Windows, os.path.join() does not put a name such as 'C:foo' below a
destination that has no drive, so the 'tar' and 'data' filters now refuse
names and link targets with a drive, after normalization.
Fixes CVE-2026-107784.

reported by Girish Konda

ANT-2026-RSL1F4AT
(cherry picked from commit e4c751b)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please record the CVE metadata in the standard format, rather than in the prose?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where do we describe what form should be used?

Our docs compilation accepted the :cve: ReST tag so I assumed that counted. is that not considered "the standard format"? it appears elsewhere in our docs.

can we make forms we don't want fail to pass CI? prevention is the best medicine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the:

.. cve: xxx

at the top of the file. That way it’s rendered beside the issue number in the changelog.

It would be a little hard to verify in the CI, there may be false positives…

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants