FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-156026: Add warning about link targets to tarfile.tar_filter by encukou · Pull Request #159019 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
18 changes: 7 additions & 11 deletions Doc/library/tarfile.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1137,17 +1137,13 @@ reused in custom filters:
Return the modified ``TarInfo`` member.

.. warning::
This filter does not check :attr:`TarInfo.linkname`. This means it does
not limit where a symbolic link member points. An absolute symbolic-link
target will remain absolute, and a relative target may resolve outside the
extraction destination. The destination path protection described above
concerns only where the archive member itself is written, not where a
symbolic link resolves. The stricter :func:`data_filter` rejects these
unsafe link targets, raising :class:`~tarfile.AbsoluteLinkError` for
absolute link targets or :class:`~tarfile.LinkOutsideDestinationError`
for link targets outside the destination.

.. versionchanged:: 3.16

This filter does not check link targets (:attr:`TarInfo.linkname`).
It allows benign cases (like links to ``/dev/null``), but it also allows
links (symbolic and hard) to arbitrary files on the filesystem,
potentially granting unintended access to these files.

.. versionchanged:: next

Filenames containing ``..`` components are now normalized.

Expand Down
Loading

Back | FazBrowse Home | New Git URL