Skip to content

[3.14] gh-149486: tarfile.data_filter: validate written link target (GH-149487)#149554

Open
miss-islington wants to merge 2 commits intopython:3.14from
miss-islington:backport-5784119-3.14
Open

[3.14] gh-149486: tarfile.data_filter: validate written link target (GH-149487)#149554
miss-islington wants to merge 2 commits intopython:3.14from
miss-islington:backport-5784119-3.14

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented May 8, 2026

The data filter rewrote linknames with normpath() but ran the
containment check against the un-normalised value, and computed a
symlink's directory before stripping trailing slashes. Both let a
crafted archive create links pointing outside the destination. Also
reject link members that resolve to the destination directory itself,
which could otherwise replace it with a symlink and redirect all
subsequent members.

(Patch by Greg; Petr's just reviewing & merging.)
(cherry picked from commit 5784119)

Co-authored-by: Petr Viktorin encukou@gmail.com
Co-authored-by: Gregory P. Smith greg@krypto.org

…ythonGH-149487)

The data filter rewrote linknames with normpath() but ran the
containment check against the un-normalised value, and computed a
symlink's directory before stripping trailing slashes.  Both let a
crafted archive create links pointing outside the destination.  Also
reject link members that resolve to the destination directory itself,
which could otherwise replace it with a symlink and redirect all
subsequent members.

(Patch by Greg; Petr's just reviewing & merging.)
(cherry picked from commit 5784119)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@encukou
Copy link
Copy Markdown
Member

encukou commented May 8, 2026

!buildbot Windows

@bedevere-bot
Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit 4b1dba7 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F149554%2Fmerge

The command will test the builders whose names match following regular expression: Windows

The builders matched are:

  • AMD64 Windows Server 2022 NoGIL PR
  • AMD64 Windows11 Refleaks PR
  • ARM64 Windows PR
  • AMD64 Windows PGO Tailcall PR
  • AMD64 Windows PGO NoGIL Tailcall PR
  • ARM64 Windows Non-Debug PR
  • AMD64 Windows11 Non-Debug PR
  • AMD64 Windows PGO NoGIL PR
  • AMD64 Windows PGO PR
  • AMD64 Windows10 PR

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants