Skip to content

Commit f5c5877

Browse files
committed
gh-156026: Add warning about link targets to tarfile.tar_filter
1 parent b22a8c9 commit f5c5877

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎Doc/library/tarfile.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,13 @@ reused in custom filters:
11241124

11251125
Return the modified ``TarInfo`` member.
11261126

1127+
.. warning::
1128+
1129+
This filter does not check link targets (:attr:`TarInfo.linkname`).
1130+
It allows benign cases (like links to ``/dev/null``), but it also allows
1131+
links (symbolic and hard) to arbitrary files on the filesystem,
1132+
potentially granting unintended access to these files.
1133+
11271134
.. versionchanged:: next
11281135

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

0 commit comments

Comments
 (0)